What is singleton pattern?
No Answer is Posted For this Question
Be the First to Post Answer
What is a native method in java programming?
What is the purpose of the System class?
How to display all the prime numbers between 1 and n (n is the number, get the input from user)
What is the exception hierarchy in java?
public class Garbage { int a=0; public void add() { int c=10+20; System.out.println(c); System.out.println(a); } public static void main(String args[]) { Garbage obj=new Garbage(); System.gc(); System.out.println("Garbage Collected"); obj.add(); } } Above is a code in java used for garbage collection. object obj has been created for the class Garbage and system.gc method is called. Then using that object add method is called.System.gc method if called the obj should be garbage collected?
What do you know about the garbate collector?
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); } }
Write a java program to print fibonacci series?
How can we avoid including a header more than once?
What classes of exceptions, caught by a catch clause?
What is the exact difference in between Unicast and Multicast object ?
What are keyboard events?