Java Test


Java is an Object Oriented Language !!!



public class Test
{
public static void main(String [] args)
{
signed int x=10;
for(int y=0;y<5;y++,x--)
System.out.print(" "+x);
}
}





Correct Answer :   C.   Compilation fails







Correct Answer :   B.   native







Correct Answer :   A.   class, if, void, long, Int, continue







Correct Answer :   B.   unsigned







Correct Answer :   C.   boolean b3 = false;







Correct Answer :   D.   0 to 65535







Correct Answer :   A.   String s1 = null;







Correct Answer :   B.   int [] a = {23,22,21,20,19};


public class CommandArgs
{
public static void main(String [] args)
{
String s1 = args[1];
String s2 = args[2];
String s3 = args[3];
String s4 = args[4];
System.out.print(" args[2] = " + s2);
}
}





Correct Answer :   D.   An exception is thrown at runtime







Correct Answer :   D.   An exception is thrown at runtime


Submit


Home Test Tutorials Program About Us
www.000webhost.com