Method overriding in Java – With 4 real life examples

Learn method overriding in java with 4 real life examples. All examples are simulated with working pseudo source code and explained scenario. Method overriding in java is run time polymorphism and is always implemented in inheritance relationship, whatever it is base or derived class. or interface and its sub classes etc. Method overriding feature gives…

Read the full article

How to create immutable class in java – Simplest Example

Create immutable class in java by making class field final and private, providing getter setter method and returning new object with new data on object modification Technical interview question is that, make a user defined class immutable. Write a simple immutable class and Explain it. also, demonstrate that it is immutable in main program. Note…

Read the full article

What to choose between abstract class and interface if…

Answer to what to choose between abstract class and interface if both contains only abstract methods. This is the frequently asked technical interview question and two reasons are provided with examples. Elaborating the question for better understanding. You know that interface contains only abstract methods. But, consider the restriction that abstract class has only abstract…

Read the full article

Java interface – With 3 examples and FAQs

A nice note on Java interface in which interface variables, methods has been clearly explained with declaration and examples. 3 complete interface examples and interface FAQs has been included with answers. Here is the topics on interface the notes cover What is interface and uses Java interface naming convention java interface variables java interface methods…

Read the full article

Linux Multiple Choice Questions – Best Linux MCQs

Linux multiple choice questions for interview and Linux exams preparation. Most of the Linux MCQs are asked in the interviews and they have answers and explanations.   Q) Core of Linux operating system is Kernel Shell Terminal Command   Q) Which one provide command interpreter environment? Kernel Shell CPU Hardware   Q) Which directory contains…

Read the full article

Use of singleton class in java – Including 3 examples in libraries

Learn use of singleton class in java with examples including three examples used in java libraries. Singleton class is majorly used to create single or unique instance and to avoid performance issue. Singleton class is only the concept or pattern we use in java. However, to solve the problem we can use other methods. But…

Read the full article

Singleton class in java – Includes Easy Implementation Steps

Learn singleton class in java with example. Singleton class is just a concept and we can make any class singleton which we want by following some rules. Singleton class restricts the instantiation of a class to single instance and ensures that only one instance of the class exists in the application. Users e.g. other classes…

Read the full article

What is method signature in Java – Does it include return type?

What is method signature in java ? – Method signature in java includes only method name and parameters. Method return types are not included in method signature. For example, in below class method declaration only “foo(String str)” is the method signature that contains method name and parameters. Return type String should in excluded.    …

Read the full article

Java final keyword – Including 15 doubts with answers

Java final keyword – Complete notes on final keyword in java with examples and uses. Learn why to use final keyword with variables, classes and methods in java programs, including answers to 15 doubts with examples and explanations on final keyword in java language. Also, a brief note has been provided if it is mandatory…

Read the full article

MCQs – C++ Virtual Concepts

MCQ on virtual function, VPTR, VTABLE and destructors etc. for interview exams preparation. These multiple-choice questions on virtual concepts contain the answer and explanation.   Q) Which concept is not available in C++? Virtual constructor Virtual destructor Virtual function Virtual Table   Q) What is output of the following C++ program?   A::f() A::f() A::f()…

Read the full article