Garbage collection is the process of freeing unused memory in the
Which of these return type of hasNext() method of an iterator
Which part of the code gets executed whether an exception is caught or not?
Which of the following cannot be type parameterized?
Select the correct option for a valid string declaration in Java.
What will be the output of the following Java program?
class Output
{
public static void main(String args[])
{
int x = 3.14;
int y = (int) Math.abs(x);
System.out.print(y);
}
}
How can a protected modifier be accessed?
What will be the output of the following Java program?
class Abekus {
int i;
}
class Main {
public static void main(String args[]) {
Abekus a = new Abekus();
System.out.println(a.i);
}
}
public class abekus{
public static void main(String[] args){
int a = 0;
a +=5;
int b=5;
switch(a+b){
case 5: System.out.print("five"); break;
case 10:
if(a%2==0) System.out.print("even");
else System.out.print("odd");
break;
default: System.out.print("0-2");
}
}
}
import java.util.*;
public class outputs
{
public static void main(String args[])
{
LinkedList list = new LinkedList();
list.add(new Integer(3));
list.add(new Integer(9));
list.add(new Integer(5));
list.add(new Integer(1));
list.addFirst(new Integer(6));
list.addLast(new Integer(9));
Iterator i = list.iterator();
Collections.sort(list);
System.out.println(list.peekFirst());
}
}