Java Interview questions

July 30, 2016 by S4 R

Filed under java

Last modified October 21, 2016

Java Interview Questions

  1. What is the most important feature of Java?
  2. What do you mean by platform independence
  3. What is a JVM?
  4. Are JVM’s platform independent?
  5. What is the difference between a JDK and a JVM?
  6. What is a pointer and does Java support pointers?
  7. What is the base class of all classes?
  8. Does Java support multiple inheritance?
  9. Is Java a pure object oriented language?
  10. Are arrays primitive data types?
  11. What is difference between Path and Classpath?
  12. What are local variables?
  13. What are instance variables?
  14. How to define a constant variable in Java?
  15. What is the return type of the main() method?
  16. What is the return type of the main() method?
  17. Why is the main() method declared static?
  18. 18What is the arguement of main() method?
  19. Can a main() method be overloaded?
  20. Can a main() method be declared final?
  21. Does the order of public and static declaration matter in main() method?
  22. Can a source file contain more than one class declaration?
  23. What is a package?
  24. Which package is imported by default?
  25. Can a class declared as private be accessed outside it’s package?
  26. Can a class be declared as protected?
  27.  What is the access scope of a protected method?
  28. What is the purpose of declaring a variable as final?
  29. What is the impact of declaring a method as final?
  30. I don’t want my class to be inherited by any other class. What should i do?
  31.  Can you give few examples of final classes defined in Java API?
  32. How is final different from finally and finalize()?
  33. Can a class be declared as static?
  34. When will you define a method as static?
  35. What are the restriction imposed on a static method or a static block of code?
  36. I want to print “Hello” even before main() is executed. How will you achieve    that?
  37. What is the importance of static variable?
  38.  Can we declare a static variable inside a method?
  39. What is an Abstract Class and what is it’s purpose?
  40. Can a abstract class be declared final?
  41. What is use of a abstract variable?
  42. Can you create an object of an abstract class?

Leave a Comment