CSS Position Relative

Chandu yadav
Updated on 22-Jun-2020 07:42:43

176 Views

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

Difference Between Objects and Classes in C#

Samual Sam
Updated on 22-Jun-2020 07:42:42

342 Views

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

Difference Between Keywords 'const' and 'readonly' in C#

karthikeya Boyini
Updated on 22-Jun-2020 07:41:19

424 Views

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;    } }

Difference Between Read and ReadLine Methods in C#

George John
Updated on 22-Jun-2020 07:40:15

859 Views

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...

Overcoming NULL in SQL CONCAT Function

Samual Sam
Updated on 22-Jun-2020 07:39:12

393 Views

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

Different Ways for Integer to String Conversions in C#

Chandu yadav
Updated on 22-Jun-2020 07:39:03

16K+ Views

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 in C#

Samual Sam
Updated on 22-Jun-2020 07:38:24

2K+ Views

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

Scope of Variables Inside MySQL Stored Procedure

Jennifer Nicholas
Updated on 22-Jun-2020 07:38:09

279 Views

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

MySQL Environment Preservation at Stored Procedure Creation

seetha
Updated on 22-Jun-2020 07:37:13

138 Views

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

Difference Between Declaration and Definition in C#

karthikeya Boyini
Updated on 22-Jun-2020 07:37:03

12K+ Views

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

Advertisements