George John has Published 1167 Articles

CSS position: static;

George John

George John

Updated on 22-Jun-2020 07:34:21

269 Views

The position: static; property sets the position of an element static, which is the default.ExampleThe top, bottom, left, and right properties does not affect the the static positioned elements. You can try to run the following code to implement the CSS position: static; propertyLive Demo           ... Read More

What is the difference between break and continue statements in C#?

George John

George John

Updated on 22-Jun-2020 07:33:25

2K+ Views

The break statement terminates the loop and transfers execution to the statement immediately following the loop.The continue statement causes the loop to skip the remainder of its body and immediately retest its condition prior to reiterating.When the break statement is encountered inside a loop, the loop is immediately terminated and program control ... Read More

Style every elements that is the last child of its parent with CSS

George John

George John

Updated on 22-Jun-2020 05:58:52

90 Views

To style every elements that is the last child of its parent, use the CSS :last-child selector. You can try to run the following code to implement the :last-child selectorExampleLive Demo                    p:last-child {             background: orange;          }                     This is demo text1.       This is demo text2.       This is demo text3.     Output

What is the difference between String.Copy() and String.Clone() methods in C#?

George John

George John

Updated on 21-Jun-2020 16:55:18

405 Views

The String.Copy() method creates a new instance of String. This is same as the specified String.The following is an example of Copy() method −Example Live Demousing System; class Demo {    static void Main(String[] args) {       string str1 = "mark";       string str2 = "marcus"; ... Read More

StringWriter vs StringReader in C#?

George John

George John

Updated on 21-Jun-2020 16:44:42

253 Views

StringReader and StringWriter derive from TextReader and TextWriterStringWriter is used for writing into a string buffer. It implements a TextWriter for writing information to a string.For StringWriter −ExampleStringWriter sWriter = new StringWriter(); while(true) {    myChar = strReader.Read();    if(myChar == -1) break;    convertedChar = Convert.ToChar(myChar);    if(convertedChar ... Read More

What is the difference between overriding and shadowing in C#?

George John

George John

Updated on 21-Jun-2020 16:28:20

1K+ Views

The following are the differences between overriding and shadowing −Shadowing redefines the complete method, whereas overriding redefines only the implementation of the method.In Overriding, you can access the base class using the child class’ object overridden method.. Shadowing has cannot access the chaild class methos.Shadowing is also known as method ... Read More

Networking in C#

George John

George John

Updated on 21-Jun-2020 16:25:00

2K+ Views

The .NET Framework has a layered, extensible, and managed implementation of networking services. You can easily integrate them into your applications. Use the System.Net; namespace.Let us see how to acess the Uri class:.In C#, it provides object representation of a uniform resource identifier (URI) −Uri uri = new Uri("http://www.example.com/"); WebRequest ... Read More

Swap two variables in one line using C#

George John

George John

Updated on 21-Jun-2020 16:13:35

421 Views

To swap two variables in a single line using the Bitwise XOR Operator.val1 = val1 ^ val2 ^ (val2 = val1);Above, we have set the values −int val1 = 30; int val2 = 60;The following is the example to swap both the variable in one line using C# −Exampleusing System; ... Read More

Nested Classes in C#

George John

George John

Updated on 21-Jun-2020 16:09:53

448 Views

Nested class is a class declared in another enclosing class. It is a member of its enclosing class and the members of an enclosing class have no access to members of a nested class.Let us see an example code snippet of nested classes in C# −Exampleclass One {    public ... Read More

Overloaded method and ambiguity in C#

George John

George John

Updated on 21-Jun-2020 16:04:20

691 Views

With method overloading, you can have multiple definitions for the same function name in the same scope. The definition of the function must differ from each other by the types and/or the number of arguments in the argument list.Let us see an example. In this the call would go to ... Read More

Advertisements