The position: relative; property allows you to position element relative to its normal position. You can try to run the following code to implement CSS position: relative;ExampleLive Demo div { position: relative; left: 20px; border: 3px solid blue; } Positioning Element div element with position: relative; Output
C# has object and classes like Java. Objects are real-world entities and instance of a class. Access the members of the class using an object.To access the class members, you need to use the dot (.) operator after the object name. The dot operator links the name of an object with the name of a member, for example, Box Box1 = new Box();Above you can see Box1 is our object. We will use it to access the members.Box1.height = 3.0;You can also use it to call member functions.Box1.getVolume();The following is an example showing how objects and class work in C#.Example Live ... Read More
ConstConstant fields are the fields that cannot be modified. At the time of declaration, you need to assign a value to it.const int a = 5;ReadonlyA Read-only field is initialized at the time of declaration or you can also set it within the constructor.Let us see an example in which the read-only field is initialized inside the constructor −Exampleclass Calculate { readonly int z; public Demo( ) { z = 20; } }
Read()The Read() reads the next characters from the standard input stream. If a key is pressed on the console, then it would close.int a = Console.Read() Console.WriteLine(a);ReadLine()It reads the next line of characters from the standard input stream.Example Live Demousing System; class Program { static void Main() { int x = 10; Console.WriteLine(x); Console.Write("Press any key to continue... "); Console.ReadLine(); } }Output10 Press any key to continue...
Problem Statement How can we overcome the property of CONCAT() function that it returns NULL if any one of the argument is NULL, especially when we want to concatenate the values from the column and any of the columns have NULL as its value? The above-said property is not useful especially in the case when we want to concatenate the values from the column and any of the columns have NULL as its value. To overcome this, we can use IFNULL() function along with CONCAT() function. To ... Read More
The easiest way to convert an integer to a string in C# is using the ToString() method.Let us see an example −int a = 100; string str = a.ToString();Another way is to use Convert.ToString();b = 50; string str2 = Convert.ToString(b); Console.WriteLine(str2);The following is the example showing the different ways to convert integer to string.Example Live Demousing System; class Program { static void Main() { int a, b, c; a = 10; string str = a.ToString(); Console.WriteLine(str); b = 50; string str2 = Convert.ToString(b); Console.WriteLine(str2); c = 100; string str3 = string.Format("{0}", c); Console.WriteLine(str3); } }Output10 50 100
The Object class is the base class of all the classes in C#. It has the following methods on C#.Sr.NoMethod & Description1Equals(Object)Determines whether the specified object is equal to the current object.2Equals(Object, Object, Determines whether the specified object instances are considered equal.3Finalize()Allows an object to try to free resources4GetHashCode()default hash function.5GetType()Type of the current instance.6MemberwiseClone()shallow copy of the current Object.7ReferenceEquals(Object, Object)Determines whether the specified Object instances are the same instance.8ToString()Returns a string that represents the current object.Let us see an example how to create an object of a class in C#.Example Live Demousing System; namespace MyApplication { class Demo { ... Read More
Suppose if we declare a variable inside a BEGIN/END block then the scope of this variable would be in this particular block. We can also declare a variable with the same name inside another BEGIN/END block which will be totally legal but its scope would be inside its BEGIN/END block. It can be understood with the help of the following example in which we are creating a procedure to show the scope of the variables −Examplemysql> Create Procedure Scope_variables() -> BEGIN -> DECLARE A Varchar(5) Default 'outer'; -> BEGIN -> DECLARE A ... Read More
Actually, MySQL preserves the environment at the time the stored procedure is created. It can be understood with the help of following the example in which we are using two bars for concatenating strings. This is only legal while SQL mode is ansi. But if we change the SQL mode to non-ansi, the procedure still works as if the original setting is still true.Examplemysql> Set sql_mode = 'ansi'// Query OK, 0 rows affected, 1 warning (0.14 sec) mysql> Create Procedure Con_string() -> SELECT 'a'||'b'// Query OK, 0 rows affected (0.12 sec) mysql> Call Con_string (); +----------+ | ... Read More
Declaration means that variable is only declared and memory is allocated, but no value is set.However, definition means the variables has been initialized.The same works for variables, arrays, collections, etc.VariablesDeclaring a variable.int x;Let’s define and assign a value.x = 10; ArraysDeclaring an array.int [] n // declaring int n= new int[10]; // initializingLet’s assign a value.n[0] = 100; n[1] = 200
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP