Unlike C++, in Java programming copy constructors are not created by default. The programmer has to code the copy constructor separately in java. Java copy constructor accepts only one argument and this argument must belong to the same type of the constructor. Copy constructor is method where an instance of a class is taken and […]
What is Finally Block?
Finally block in Java is used to execute the important codes such as stream and closing connection. Even if you don’t handle the exception java finally block will always be executed. Every finally block must be followed by run or catch block. A finally statement is always associated with try statement. Finally block identifies the […]
What is Java bytecode? Is it platform independent?
What is JVM? Java Virtual Machine is a machine language architecture developed by the Sun Micro systems to compile the programs written using Java. JVM is introduced as a cross-platform computing program. There are several components used in JVM: Stack: It is the storage area for methods and variables. It can be changed according to […]
Java interview Questions & Answers
This Java Questions and Answers are prepared with the students and those preparing for their interviews in mind. The questions have been designed by the leading experts from various Educational and Corporate Institutions. This covers all the aspects of the language needed for the easy understanding and the appreciation of the language usefulness. The best […]
What is a Private Constructor in Java
Most novice programmers are not aware of the possibility to have private constructor in Java. Private constructor is special constructor which is commonly used in classes containing static members. In classes which have private constructor and no public constructor, other classes won’t create any instance in this class. When methods are declared as a private […]
Difference between method overloading and overriding
The confusion between the method overloading and method overriding is a common problem among novice Java programmers. This article will provide you the explanations for overloading and overriding with some fair examples. What is Method Overloading? When two or more methods belonging to same class with similar name and different parameters, method overloading occurs. Always […]
How the System.out.println() is working in Java?
Most interviewers don’t expect the correct answer for this question. But this question is asked to know about the candidate’s knowledge about Java and their thinking ability. This question is a sample for how you can solve a problem with some fundamental dogma in Java. In Java, dot operator is only used to call variables […]