What is the purpose of static methods and static variables?


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More Core Java Interview Questions

How can we run a java program without making any object?

0 Answers  


What is the size of an array?

0 Answers  


Can a static class have a constructor?

0 Answers  


What is preparedstatement in java?

0 Answers  


What is the difference between access specifiers and access modifiers in java?

0 Answers  






How do you read and print a string in java?

0 Answers  


10. What is the output of the following Java program? class Main { public static void main(String args[]){ final int i; i = 10; System.out.println(i); } } 10. What is the output of the following Java program? class Main { public static void main(String args[]){ final int i; i = 10; System.out.println(i); } }

0 Answers  


Can we change the scope of the overridden method in the subclass?

0 Answers  


What is a parameter example?

0 Answers  


When should we create our own custom exception classes?

0 Answers  


11. static class A { 12. void process() throws Exception { throw new Exception(); } 13. } 14. static class B extends A { 15. void process() { System.out.println(”B”); } 16. } 17. public static void main(String[] args) { 18. new B().process(); 19. } What is the result? 1 B 2 The code runs with no output. 3 Compilation fails because of an error in line 12. 4 Compilation fails because of an error in line 15.

6 Answers  


What is class??

0 Answers   Tech Mahindra,


Categories