Core java interview questions on Java static keyword
1. What is the difference between static and non-static variables ?
2. What is class variables ?
3. When is static variable loaded? Is it at compile time or runtime? When exactly a static block is loaded in Java ?
4. What is static block ?
5. What are static methods ?
6. Can a class be declared as static ?
7. When will you define a method as static ?
8. What are restriction placed on a static method or static block of code ?
9. What is the importance of static variable ?
10. Can we declare a static variable inside a method ?
11. What is the difference between a static and a non-static inner class ?
12. What it means that method or field is static ?
13. What happens to static variable that is defined within method of a class ?
14. How many static initializers you can keep ?
15. What is the difference between static binding and dynamic binding ?
16. What is static import ?
17. Can you declare interface method static?
18. Can we override static method?
19. Why we cannot override static method?
20. What is difference between static (class) method and instance method?
21. What is the difference between inner class and nested class?
22. What is static in java ?
Check out all interview questions:
- All core java interview questions
- All java collections interview questions
- Face to face java Interview questions
- Telephonic java interview questions