1 New Message
Digest #1883
Message
Thu Oct 17, 2013 8:44 pm (PDT) . Posted by:
"Pooja" dial2pooja
____________
Cool Interview Questions
* Data Warehousing
____________
* Microsoft
____________
* Languages
____________
* J2EE
____________
* Oracle
____________
* Audit
____________
* SAP
____________
* Siebel
____________
* Operating Systems
____________
* Oracle Apps
____________
* Testing
____________
* 8085 Micro processor
____________
* Bluetooth
____________
* Networking
____________
* Database
____________
* QTP
____________
* Web
____________
* Winrunner
____________
* Hardware
____________
* Telecommunications
____________
* Mainframe
____________
* Loadrunner
____________
* Microsoft Office
Operating Systems
* Microsoft Windows Interview Questions
____________
* UNIX Interview Questions
____________
* Linux Interview Questions
____________
* Solaris Interview Questions
____________
* Shell Scripting Interview Questions
____________
* Stored Procedures Interview Questions
Testing
* Software Testing Interview Questions
____________
* Bug Tracking Interview Questions
____________
* Database Testing Interview Questions
____________
* Product Testing Interview Questions
____________
* Whitebox Testing Interview Questions
____________
* Wireless Testing Interview Questions SUN CERTIFIED JAVA DEVELOPER INTERVIEW QUESTIONS
Download Free Interview Questions eBook of 500 Questions
(If you do not have a Yahoo! account, you can get it by simply sending a blank email to CoolInterview-
Sun Certified Java Developer Interview Questions
* What is native keyword and abstract keyword?
http://www.coolinte
* IF you are remotely logged on to a Solaris machine, What command would you execute?
http://www.coolinte
* 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
http://www.coolinte
* how to include the input of the output file in java script?
http://www.coolinte
* Given:
1. public class Threads2 implements Runnable {
2.
3. public void run() {
4. System.out.println(
5. throw new RuntimeException(
6. }
7. public static void main(String[
8. Thread t = new Thread(new Threads2());
9. t.start();
10. System.out.println(
11. }
12. }
Which two can be results? (Choose two.)
A. java.lang.RuntimeEx
B. run. java.lang.RuntimeEx
C. End of method. java.lang.RuntimeEx
D. End of method. run. java.lang.RuntimeEx
E. run. java.lang.RuntimeEx
http://www.coolinte
* 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() method's 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(
http://www.coolinte
* QUESTION 3
Given:
7. void waitForSignal(
8. Object obj = new Object();
9. synchronized (Thread.currentThre
10. obj.wait();
11. obj.notify()
12. }
13. }
Which statement is true?
A. This code can throw an InterruptedExceptio
B. This code can throw an IllegalMonitorState
C. This code can throw a TimeoutException after ten minutes.
D. Reversing the order of obj.wait() and obj.notify() might cause this method to complete normally.
E. A call to notify() or notifyAll() from another thread might cause this method to complete normally.
F. This code does NOT compile unless "obj.wait(
http://www.coolinte
* Given:
11. class PingPong2 {
12. synchronized void hit(long n) {
13. for(int i = 1; i < 3; i++)
14. System.out.print(
15. }
16. }
17. public class Tester implements Runnable {
18. static PingPong2 pp2 = new PingPong2();
19. public static void main(String[
20. new Thread(new Tester()).start(
21. new Thread(new Tester()).start(
22. }
23. public void run() { pp2.hit(Thread.
24. }
Which statement is true?
A. The output could be 5-1 6-1 6-2 5-2
B. The output could be 6-1 6-2 5-1 5-2
C. The output could be 6-1 5-2 6-2 5-1
D. The output could be 6-1 6-2 5-1 7-1
http://www.coolinte
* 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(
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.
http://www.coolinte
* Given:
11. public abstract class Shape {
12. private int x;
13. private int y;
14. public abstract void draw();
15. public void setAnchor(int x, int y) {
16. this.x = x;
17. this.y = y;
18. }
19. }
Which two classes use the Shape class correctly? (Choose two.)
A. public class Circle implements Shape { private int radius; }
B. public abstract class Circle extends Shape { private int radius; }
C. public class Circle extends Shape { private int radius; public void draw(); }
D. public abstract class Circle implements Shape { private int radius; public void draw(); }
E. public class Circle extends Shape { private int radius; public void draw() {/* code here */}
F. public abstract class Circle implements Shape { private int radius; public void draw() { /* code here */ }
http://www.coolinte
* Given:
11. public class Barn {
12. public static void main(String[
13. new Barn().go("
14. new Barn().go("
15. }
16. public void go(String... y, int x) {
17. System.out.print(
18. }
19. }
What is the result?
A. hi hi
B. hi world
C. world world
D. Compilation fails.
E. An exception is thrown at runtime.
http://www.coolinte
* Given:
10. class Nav{
11. public enum Direction { NORTH, SOUTH, EAST, WEST }
12. }
13. public class Sprite{
14. // insert code here
15. }
Which code, inserted at line 14, allows the Sprite class to compile?
A. Direction d = NORTH;
B. Nav.Direction d = NORTH;
C. Direction d = Direction.NORTH;
D. Nav.Direction d = Nav.Direction.
http://www.coolinte
* Given:
11. public class Rainbow {
12. public enum MyColor {
13. RED(0xff0000)
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[
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(
D. Compilation fails due to other error(s) in the code.
E. MyColor purple = new MyColor(0xff00ff)
F. MyColor purple = MyColor.BLUE + MyColor.RED;
http://www.coolinte
* Given:
11. class Mud {
12. // insert code here
13. System.out.println(
14. }
15. }
And the following five fragments:
public static void main(String.
public static void main(String.
public static void main(String.
public static void main(String[
public static void main(String.
How many of the code fragments, inserted independently at line 12, compile?
A. 0
B. 1
C. 2
D. 3
E. 4
F. 5
http://www.coolinte
* Given:
5. class Atom {
6. Atom() { System.out.print(
7. }
8. class Rock extends Atom {
9. Rock(String type) { System.out.print(
10. }
11. public class Mountain extends Rock {
12. Mountain() {
13. super("
14. new Rock("granite ");
15. }
16. public static void main(String[
17. }
What is the result?
A. Compilation fails.
B. atom granite
C. granite granite
D. atom granite granite
E. An exception is thrown at runtime.
F. atom granite atom granite
http://www.coolinte
* Given:
1. interface TestA { String toString(); }
2. public class Test {
3. public static void main(String[
4. System.out.println(
5. public String toString() { return "test"
6. });
7. }
8. }
What is the result?
A. test
B. null
C. An exception is thrown at runtime.
D. Compilation fails because of an error in line 1.
E. Compilation fails because of an error in line 4.
F. Compilation fails because of an error in line 5.
http://www.coolinte
* Given:
11. public static void parse(String str) {
12. try {
13. float f = Float.parseFloat(
14. } catch (NumberFormatExcept
15. f = 0;
16. } finally {
17. System.out.println(
18. }
19. }
20. public static void main(String[
21. parse("
22. }
What is the result?
A. 0.0
B. Compilation fails.
C. A ParseException is thrown by the parse method at runtime.
D. A NumberFormatExcepti
http://www.coolinte
* 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; }
http://www.coolinte
* 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); }
http://www.coolinte
* 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; }
F. class Man { private BestFriend; }
http://www.coolinte
* 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
http://www.coolinte
* QUESTION 21
Given:
11. abstract class Vehicle { public int speed() { return 0; }
12. class Car extends Vehicle { public int speed() { return 60; }
13. class RaceCar extends Car { public int speed() { return 150; } ...
21. RaceCar racer = new RaceCar();
22. Car car = new RaceCar();
23. Vehicle vehicle = new RaceCar();
24. System.out.println(
25. + ", " + vehicle.speed(
What is the result?
A. 0, 0, 0
B. 150, 60, 0
C. Compilation fails.
D. 150, 150, 150
E. An exception is thrown at runtime.
http://www.coolinte
* Given:
5. class Building { }
6. public class Barn extends Building {
7. public static void main(String[