Tag: programming languages
Questions Related to programming languages
Which of the following lines will compile without warning or error.
A byte can be of what size?
What will be printed out if this code is run with the following command line? java myprog good morning public class myprog{ public static void main(String argv[]) { System.out.println(argv[2]); } }
Which of the following are keywords or reserved words in Java?
What will be printed out if you attempt to compile and run the following code ? int i=1; switch (i) { case 0: System.out.println("zero"); break; case 1: System.out.println("one"); case 2: System.out.println("two"); default: System.out.println("default"); }
Given the following declarations String s1=new String("Hello"); String s2=new String("there"); String s3=new String(); Which of the following are legal operations?
You need to create a class that will store unique object elements. You do not need to sort these elements but they must be unique. What interface might be most suitable to meet this need?