Sun Certified Java Developer Interview Preparation Guide

Elevate your Sun Certification interview readiness with our detailed compilation of 20 questions. These questions are specifically selected to challenge and enhance your knowledge in Sun Certification. Perfect for all proficiency levels, they are key to your interview success. Secure the free PDF to access all 20 questions and guarantee your preparation for your Sun Certification interview. This guide is crucial for enhancing your readiness and self-assurance.
Tweet Share WhatsApp

20 Sun Certification Questions and Answers:

1 :: Explain What is the result of mounting a file system with thenoatimeoption enabled?
A.It enables the UFS logging
B.It disables the update of file access times
C.It prevents the creation of files larger than 2Gbytes
D.It prevents the user from updating the file modification times

B.It disables the update of file access times
Download PDFRead All Sun Certification Questions

2 :: Can you explain Given:
5. class Building { }
6. public class Barn extends Building {
7. public static void main(String[] args) {
8. Building build1 = new Building();
9. Barn barn1 = new Barn();
10. Barn barn2 = (Barn) build1;
11. Object obj1 = (Object) build1;
12. String str1 = (String) build1;
13. Building build2 = (Building) barn1;
14. }
15. }
Which is true?
A. If line 10 is removed, the compilation succeeds.
B. If line 11 is removed, the compilation succeeds.
C. If line 12 is removed, the compilation succeeds.
D. If line 13 is removed, the compilation succeeds.
E. More than one line must be removed for compilation to succeed.

C: If line 12 is removed, the compilation succeeds.

3 :: Explain Which Man class properly represents the relationship "Man has a best friend who is a Dog"?
A. class Man extends Dog { }
B. class Man implements Dog { }
C. class Man { private BestFriend dog; }
D. class Man { private Dog bestFriend; }
E. class Man { private Dog<bestFriend>; }
F. class Man { private BestFriend<dog>; }

D:class Man { private Dog bestFriend; }

4 :: Explain Given:
1. package test;
2.
3. class Target {
4. public String name = "hello";
5. }
What can directly access and change the value of the variable name?
A. any class
B. only the Target class
C. any class in the test package
D. any class that extends Target

C:any class in the test package

5 :: Explain Given:
1. public class Threads4 {
2. public static void main (String[] args) {
3. new Threads4().go();
4. }
5. public void go() {
6. Runnable r = new Runnable() {
7. public void run() {
8. System.out.print("foo");
9. }
10. };
11. Thread t = new Thread(r);
12. t.start();
13. t.start();
14. }
15. }
What is the result?
A. Compilation fails.
B. An exception is thrown at runtime.
C. The code executes normally and prints "foo".
D. The code executes normally, but nothing is printed.

B:An exception is thrown at runtime.
Download PDFRead All Sun Certification Questions

6 :: Explain Given:
11. public class Rainbow {
12. public enum MyColor {
13. RED(0xff0000), GREEN(0x00ff00), BLUE(0x0000ff);
14. private final int rgb;
15. MyColor(int rgb) { this.rgb = rgb; }
16. public int getRGB() { return rgb; }
17. };
18. public static void main(String[] args) {
19. // insert code here
20. }
21. }
Which code fragment, inserted at line 19, allows the Rainbow class to compile?
A. MyColor skyColor = BLUE;
B. MyColor treeColor = MyColor.GREEN;
C. if(RED.getRGB() < BLUE.getRGB()) { }
D. Compilation fails due to other error(s) in the code.
E. MyColor purple = new MyColor(0xff00ff);
F. MyColor purple = MyColor.BLUE + MyColor.RED;

B:MyColor treeColor = MyColor.GREEN;

7 :: Explain Given:
1. class Super {
2. private int a;
3. protected Super(int a) { this.a = a; }
4. }
...
11. class Sub extends Super {
12. public Sub(int a) { super(a); }
13. public Sub() { this.a = 5; }
14. }
Which two, independently, will allow Sub to compile? (Choose two.)
A. Change line 2 to:
public int a;
B. Change line 2 to:
protected int a;
C. Change line 13 to:
public Sub() { this(5); }
D. Change line 13 to:
public Sub() { super(5); }
E. Change line 13 to:
public Sub() { super(a); }

C:Change line 13 to:
public Sub() { this(5); }
D:Change line 13 to:
public Sub() { super(5); }

8 :: Explain Which two statements are true? (Choose two.)
A. It is possible for more than two threads to deadlock at once.
B. The JVM implementation guarantees that multiple threads cannot enter into a deadlocked state.
C. Deadlocked threads release once their sleep() methods sleep duration has expired.
D. Deadlocking can occur only when the wait(), notify(), and notifyAll() methods are used incorrectly.
E. It is possible for a single-threaded application to deadlock if synchronized blocks are used incorrectly.
F. If a piece of code is capable of deadlocking, you cannot eliminate the possibility of deadlocking by inserting
invocations of Thread.yield().

A: It is possible for more than two threads to deadlock at once.
F:If a piece of code is capable of deadlocking, you cannot eliminate the possibility of deadlocking by inserting
invocations of Thread.yield().

9 :: Tell me What is native keyword and abstract keyword?

Native keyword is prefixed with method name when we want that method to be implemented using a native language like c and c++. So in the class we only declare the method and the definition of the method is in the dll file.

Abstract key word is used to mark a method or a class as logically incomplete. The class which extends this class has to provide the definition of the method or has to declare the derived class as abstract.

We can not declare a native method inside a interface because by declaring a method in an interface we want all the implementers to give definitions to the methods defined. But by declaring a method native we mean that the implementation will come from some native language.

10 :: Explain Given:
1. public class Blip {
2. protected int blipvert(int x) { return 0; }
3. }
4. class Vert extends Blip {
5. // insert code here
6. }
Which five methods, inserted independently at line 5, will compile? (Choose five.)
A. public int blipvert(int x) { return 0; }
B. private int blipvert(int x) { return 0; }
C. private int blipvert(long x) { return 0; }
D. protected long blipvert(int x) { return 0; }
E. protected int blipvert(long x) { return 0; }
F. protected long blipvert(long x) { return 0; }
G. protected long blipvert(int x, int y) { return 0; }

A:public int blipvert(int x) { return 0; }
C:private int blipvert(long x) { return 0; }
E:protected int blipvert(long x) { return 0; }
F:protected long blipvert(long x) { return 0; }
G:protected long blipvert(int x, int y) { return 0; }
Download PDFRead All Sun Certification Questions