Core Java interview questions 1 -2 Years | Inheritance, Nested Class, Inner Class

Inheritance: Inheritance is the property of deriving a class from an existing class (called as base class) such that the derived class inherits all the characteristics of base class and it can also have its own properties. A derived class inherits the public, protected members of the base class. A derived class is usually larger than the base class, since it normally adds data members and member function in addition to what it inherits from the class. Single Inheritance: A derived class with only one…

Continue reading »

What all we need to know about Core Java – Level 1

Points to Remember: Sun Microsystems have defined the java languages as simple, objecct-orineted, distributed, interpreted, robust, architecture neutral, portable, multithreaded, dynamic. A platform is the hardware or system software environment in which your program runs. Java compiler after compiling the program creates a new file referred as the class file, which contains a special code referred as the byte codes. It is similar to machine language, but unlike machine language java byte code is exactly the same on every platform. JVM stands for Java Virtual…

Continue reading »

The abstract keyword in Java

An abstract class is not required to have an abstract method in it. But any class that has an abstract method in it or that does not provide a definition for any abstract methods declared in its super classes must be declared as an abstract method. Example: Class Employee abstract class Employee { abstract void show(); void name(){ System.out.println(“Non abstract method”); } } Class Department public class Department extends Employee{ @Override void show() { // TODO Auto-generated method stub System.out.println(“Abstract Method in Sub Class”); }…

Continue reading »