what is singleton class in java?
No Answer is Posted For this Question
Be the First to Post Answer
I declared main() method as private. But it still running and displaying the output. Please Answer it . Code Snippet as Below: import java.io.*; class over { private static void main(String[] args) { int high = Integer.MAX_VALUE; int overflow = high + 1; int low = Integer.MIN_VALUE; int underflow = low - 1; System.out.println(high + "\n" +overflow +"\n"+ low +"\n"+underflow); //System.out.println(overflow); //System.out.println(low); //System.out.println(underflow); } }
How to re-get an object that is collected by garbage collector?
How we can declare a static variable?
Can we sort arraylist in java?
What happens if a constructor is declared private?
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.
What does a void function return?
Can we sort array in java?
How is hashset defined in java?
What's the base class in java from which all classes are derived?
What are the string methods in java?
What is the purpose of java?