Notice: Undefined index: exam_geven in /home/ksv69uw2i08d/public_html/onlineexam/exam.php on line 18
SCJP Online Examination
Sreejobs Logo
   For Latest Job Updates  
sreenutech.com Online Exams
Home Govt Jobs IT Fresher Jobs IT Exp Jobs IT Walk-Ins MBA Jobs BPO Jobs Register FAQ’s Post Job Contact Us
Search:
SreeJob Fees   Job Feeds
Hot Jobs
Welcome Guest
Login | Register
Total No Of Questions: 100.
1)

Given:
1. package sun.scjp;
2. public enum Color { RED, GREEN, BLUE }
1. package sun.beta;
2. // insert code here
3. public class Beta {
4. Color g = GREEN;
5. public static void main( String[] argv)
6. { System.out.println( GREEN); }
7. }

The class Beta and the enum Color are in different packages.
Which two code fragments, inserted individually at line 2 of the Beta
declaration, will allow this code to compile? (Choose two.)



2) Given:
1. import java.util.*;
2. public class Old {
3. public static Object get0(List list) {
4. return list.get(0);
5. }
6. }
Which three will compile successfully? (Choose three.)



3) Given:
bw is a reference to a valid BufferedWriter And the snippet:
15. BufferedWriter b1 = new BufferedWriter(new File("f"));
16. BufferedWriter b2 = new BufferedWriter(new FileWriter("f1"));
17. BufferedWriter b3 = new BufferedWriter(new PrintWriter("f2"));
18. BufferedWriter b4 = new BufferedWriter(new BufferedWriter(bw));
What is the result?



4) Given:
11. rbo = new ReallyBigObject();
12. // more code here
13. rbo = null;
14. /* insert code here */
Which statement should be placed at line 14 to suggest that the virtual machine expend effort toward
recycling the memory used by the object rbo?



5) Given:
public abstract interface Frobnicate { public void twiddle(String s); }
Which is a correct class? (Choose all that apply.)



6) A class games.cards.Poker is correctly defined in the jar file Poker.jar. A user
wants to execute the main method of Poker on a UNIX system using the command:
java games.cards.PokerWhat allows the user to do this?



7) Given:
import java.util.*;
class Test {
public static void main(String[] args) {
// insert code here
x.add("one");
x.add("two");
x.add("TWO");
System.out.println(x.poll());
}
}
Which, inserted at // insert code here, will compile? (Choose all that apply.)



8) Given:
1. class Zing {
2. protected Hmpf h;
3. }
4. class Woop extends Zing { }
5. class Hmpf { }
Which is true? (Choose all that apply.)



9)

Given:

11. public static void test(String str) {
12. int check = 4;
13. if (check = str.length()) {
14. System.out.print(str.charAt(check -= 1) +", ");
15. } else {
16. System.out.print(str.charAt(0) + ", ");
17. }
18. }
and the invocation:
21. test("four");
22. test("tee");
23. test("to");
What is the result?



10)

Given a method declared as:

public static <E extends Number> List<? super E> process(List<E> nums)
A programmer wants to use this method like this:
// INSERT DECLARATIONS HERE
output = process(input);
Which pairs of declarations could be placed at // INSERT DECLARATIONS HERE to allow the code to compile? (Choose all that apply).


Notice: Undefined offset: 100 in /home/ksv69uw2i08d/public_html/onlineexam/exam.php on line 418
Page 1 of 10
Home | Register for Job Updates | Contact Us