JAVA Interview Questions: Dinanath Thakur
JAVA Interview Questions: Dinanath Thakur
JAVA Interview Questions: Dinanath Thakur
Dinanath Thakur
1. What do you know about Java?
Java is a high-level programming language. It is platform independent. The java code runs on a variety of
platforms, such as Windows, Mac OS, and the various versions of UNIX.
5. What is JVM?
When Java is compiled, it is not compiled into platform specific machine, rather into platform independent
byte code. This byte code is distributed over the web and interpreted by Java Virtual Machine (JVM) on
whichever platform it is being run.
28. Can a java file have more than one java class?
Yes, you can have any number of java classes in a single file. You can save the file in any name. In case of
multiple classes, only one class can be public. In this case you must save the file in public class name.
Var-args list is used to when the functionality is same and the method values are different for different method
call.
e.g. Calculating sum of marks which may vary from one subject to many subjects for students .
48. How will you call a non static(normal) method from a static method?
Use object to call a non static method
e.g. Calling a method from public static void main(String args[]) using object
50. Can you refer to a super class object (using super keyword) or a current object(using this
keyword) inside a static method?
No. super and this keyword cannot be used inside a static method.