11:01 AM
Does this code compiles?
static float[] arr3 = {} ;
Answer: Yes. Empty array
Legal Identifiers:
private int _s ; // correct
private int $USA ; // correct
private int $$$$45, ______, ss ; // correct
Is this legal?
private static int s = getS() ;
private static int y = 5 ;
private static int getS(){
return y ;
} // YES
What is the output of this code? (watch the println)
boolean log = false ;
boolean log1 = true ;
boolean log2 = false ;
boolean log3 = true ;
if ( log && !log1 || log2 || log3) {
System.out.println("############################################# :TRUE") ;
}
What is the output of this code?
Hashtable ht = new Hashtable() ;
ht.put("monday","write program") ;
ht.put("monday","read mails") ;
System.out.println( "Hash table" + ht ) ;
Answer: Hash table {Monday=read mails}
No comments:
Post a Comment