MCQOPTIONS
Bookmark
Saved Bookmarks
→
Engineering
→
C Programming
→
Which is a valid keyword in java?
1.
Which is a valid keyword in java?
A.
interface
B.
string
C.
Float
D.
unsigned
Answer» B. string
Show Answer
Discussion
No Comment Found
Post Comment
Related MCQs
class HappyGarbage01 { public static void main(String args[]) { HappyGarbage01 h = new HappyGarbage01(); h.methodA(); /* Line 6 */ } Object methodA() { Object obj1 = new Object(); Object [] obj2 = new Object[1]; obj2[0] = obj1; obj1 = null; return obj2[0]; } } Where will be the most chance of the garbage collector being invoked?
What will be the output of the program? public class Foo { public static void main(String[] args) { try { return; } finally { System.out.println( "Finally" ); } } }
Which one is a valid declaration of a boolean?
Which one of the following will declare an array and initialize it with five numbers?
Which three are valid declarations of a float? float f1 = -343; float f2 = 3.14; float f3 = 0x12345; float f4 = 42e7; float f5 = 2001.0D; float f6 = 2.81F;
Which is a valid declarations of a String?
Which three are legal array declarations? int [] myScores []; char [] myChars; int [6] myScores; Dog myDogs []; Dog myDogs [7];
Which three are valid declarations of a char? char c1 = 064770; char c2 = 'face'; char c3 = 0xbeef; char c4 = u0022; char c5 = ' iface'; char c6 = ' uface';
Which is the valid declarations within an interface definition?
public interface Foo { int k = 4; /* Line 3 */ } Which three piece of codes are equivalent to line 3? final int k = 4; public int k = 4; static int k = 4; abstract int k = 4; volatile int k = 4; protected int k = 4;
Reply to Comment
×
Name
*
Email
*
Comment
*
Submit Reply
Your experience on this site will be improved by allowing cookies. Read
Cookie Policy
Reject
Allow cookies