
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 33676 Articles for Programming

672 Views
Access Modifiers specifies the scope of variable and functions in C#. The following are the access modifiers used provided by C#:PublicThe public modifier sets no restriction on the access of members.ProtectedAccess limited to the derived class or class definition.InternalThe Internal access modifier access within the program that has its declaration.Protected internalIt has both the access specifiers provided by protected and internal access modifiers.PrivateLimited only inside the class in which it is declared. The members specified as private cannot be accessed outside the class.ExampleLet us see an example of protected access modifier, accessing the protected members −Live Demousing System; namespace MySpecifiers ... Read More

2K+ Views
Asynchronous programming in C# is an efficient approach towards activities blocked or access is delayed. If an activity is blocked like this in a synchronous process, then the complete application waits and it takes more time. The application stops responding. Using the asynchronous approach, the applications continue with other tasks as well.The async and await keywords in C# are used in async programming. Using them, you can work with .NET Framework resources, .NET Core, etc. Asynchronous methods defined using the async keyword are called async methods.An application with a GUI, check the content of the queue and if an unprocessed ... Read More

2K+ Views
An abstract class in C# includes abstract and non-abstract methods. A class is declared abstract to be an abstract class. You cannot instantiate an abstract class.Let us see an example, wherein we have an abstract class Vehicle and abstract method display()−public abstract class Vehicle { public abstract void display(); } The abstract class has derived classes: Bus, Car, and Motorcycle. The following is an implementation of the Bus derived class −public class Bus : Vehicle { public override void display() { Console.WriteLine("Bus"); } } ExampleLet us see the complete example of abstract classes in C# −Live ... Read More

1K+ Views
The Deque class uses a doubly-linked list to implement its collection of elements. The doubly-linked lists should have two nodes i.e. front and back nodes. This helps in adding elements on the front and back of the Deque.With the Deque class, you have the ability to add and remove elements from both the sides. This is why Deque is said to be a double-ended queue.The Deque class has the following methods in the Queue class −ClearClears the collection of all of its elementsContainsWhether or not an object is in the collectionToArrayUse the ToArray() method to copy all of the elements ... Read More

9K+ Views
The “this” keyword in C# is used to refer to the current instance of the class. It is also used to differentiate between the method parameters and class fields if they both have the same name.Another usage of “this” keyword is to call another constructor from a constructor in the same class.Here, for an example, we are showing a record of Students i.e: id, Name, Age, and Subject. To refer to the fields of the current class, we have used the “this” keyword in C# −public Student(int id, String name, int age, String subject) { this.id = id; ... Read More

4K+ Views
In Java, you cannot override static methods but you can overload them. Overloading a static method is allowed because the JVM determines which method to call at compile time based on the method signature, rather than the object's type. However, overriding is not allowed for static methods because an overridden method is called based on the object's type. In this article, we are going to discuss is it possible to overload and override a static method in Java. Also, we will understand static methods, method overloading and method overriding. What is a Static Method? A method defined using the static ... Read More

503 Views
With Java 8, Arrays class has a stream() methods to generate a Stream using the passed array as its source.DescriptionThe java.util.Arrays.stream() method returns a sequential Stream with the specified array as its source. −Arrays.stream(array)DeclarationFollowing is the declaration for java.util.Arrays.stream() methodpublic static Stream stream(T[] array)Type ParameterT − This is the type of the array elements.Parameterarray − This is the source array to be used.Return ValueThis method returns a stream for the array.ExampleThe following example shows the usage of java.util.Arrays.stream() method.Live Demoimport java.util.Arrays; public class Tester { public static void main(String args[]) { int data[] = { 1, ... Read More

914 Views
Here is the syntax for declaring an array variable −SyntaxdataType[] arrayRefVar; // preferred way. or dataType arrayRefVar[]; // works but not preferred way.Note − The style dataType[] arrayRefVar is preferred. The style dataType arrayRefVar[] comes from the C/C++ language and was adopted in Java to accommodate C/C++ programmers.ExampleThe following code snippets are examples of this syntax −double[] myList; // preferred way. or double myList[]; // works but not preferred way.Creating ArraysYou can create an array by using the new operator with the following syntax −SyntaxarrayRefVar = new dataType[arraySize];The above statement does two things −It creates an array ... Read More

30K+ Views
Array in Java can be copied to another array using the following ways.Using variable assignment. This method has side effects as changes to the element of an array reflects on both the places. To prevent this side effect following are the better ways to copy the array elements.Create a new array of the same length and copy each element.Use the clone method of the array. Clone methods create a new array of the same size.Use System.arraycopy() method. The arraycopy() can be used to copy a subset of an array.ExampleCreate a java class named Tester.Tester.javaLive Demopublic class Tester { public ... Read More

2K+ Views
'+' operator in java can be used to add numbers and concatenate strings. Following rules should be considered.Only numbers as operands then result will be a number.Only strings as operands then result will be a concatenated string.If both numbers and strings as operands, then numbers coming before string will be treated as numbers.If both numbers and strings as operands, then numbers coming after string will be treated as a string.Above rule can be overridden using brackets().ExampleCreate a java class named Tester.Tester.javaLive Demopublic class Tester { public static void main(String args[]) { //Scenario 1: ... Read More