Method Return Types and Parameters in C#

Learn what is method return types and parameters in C# with code example and simple explanations. You will be learning… how to return int and string data types in C# from a method. Using void keyword to prevent returning data from a method. methods parameters and how to call them by supplying the values known…

Read the full article

Printing program output / data on Console in C#

Console output in C# – Learn how to print program outputs in C# on console screen using Console.WriteLine method. You will learn how to print Strings, int and double variables etc on console. Here is a simple C# program that prints output as “I love C# Programming”. Output: I Love C# Programming Notice that string…

Read the full article

Variables and Data types in C#

Learn variables and data types in C# programming with super simple explanation with example. DATA TYPES IN C# Here are some common data types we use in C# programs. int, float, char, double, Boolean and String. Data type is a classification of data e.g. int, float, double, char and String etc. by which a programmer…

Read the full article

What is Java Thread Join method and its purpose? – Clear Example

In java Thread join method is used, so that main or parent thread can wait for its child thread to finish its execution and die. After that only main thread can executes its further statements. For example, In below thread program, main () method in Sample class is the main thread and it is creating…

Read the full article

Awesome Answer for Extending Thread Class vs Implementing Runnable interface in Java

Very nice and concise answer with examples for technical interview question what difference between Extending Thread class and Implementing Runnable Interface in Java. Before answering the differences lets have a brief note and tips that will help you answer the best. Examples of creating threads in java using extending Thread class and Runnable Interface NOTE:…

Read the full article

Why method overriding is called runtime polymorphism in Java?

Answer to why method overriding is called runtime polymorphism in java includes very simple code example with explanation, so you can understand easily. Do you think answer is difficult? In fact, it super simple. Read till end. You may read more about method overriding in java with example.   “In Run time polymorphism methods get…

Read the full article

Examples where use of Java Static method is Indispensable

Let’s see some examples where use of java static methods are mandatory in the programs. Generally, we use static method where we want to call method without creating an object of the class. Here are examples where we cannot avoid using static methods in java and are indispensable. NOTE: Generally, this question is asked to…

Read the full article

Why we need double check in singleton class in java? – Answered

Answer to why we need double check locking in singleton class in Java with thread program example.   Let’s understand first what does double checking means?   Consider the method getInstance() of below singleton class. You will see there are two if conditions to check if the singleton class object is null. So, question is,…

Read the full article