It2EDU

Wednesday, October 5, 2016

Interview Quetions in Core Java


1. Can we write multiple main() methods in java program?



Ans: Yes, we can write by override the main() method but there should be only one main() method with the standard signature like  public static void main(String args[ ]).



2. What is transient in Java?



Ans: A transient is a key word which is used to a variable that may not be serialize.



3.Explain about main() method in java?



Ans:  Public: This is the first method called by java environment when the program starts its execution. So the access specifier is public.

        Static: Java environment should call this method without creating any instance, hence static is used.

        Void: main() method does not return any thing so return type should be void.



4. Can we make abstract class as final?



Ans: Abstract class may not be declared as final.



5.Which package is import always by default in java program?



Ans: By default java.lang package is always imported.



6. What are the four main pillars of Object Oriented Programming?



Ans: Inheritance, Abstraction,Encapsulation and Polymorphism.



7. What is JVM?



Ans: In expansion of JVM is Java Virtual Machine. JVM  is an abstract computing machine that enables a computer to run a Java program. There are three notions of the JVM specification, implementation and instance. The specification is a document that formally describes what is required of a JVM implementation.



8. What is a Singleton property in Java?



Ans: Singleton is good property, java has this property. Singleton is to control the object creation  by creating constructor in private. This singleton is useful to keep only one instance per class at any time.   



9. What is WORA?



Ans: Write Once Run Anywhere (WORA)  This is a slogan for java. Means java can be developed on any device and compiled into a standard byte code and expected to run any where or any device / platform equipped with JVM.



10. List Java features?



Ans: Object Oriented, Robust,Secure,Simple,Platform Independent, Architectural neutral, Portable and Dynamic.

3 comments: