20:00

Free Test
/ 10

Quiz

1/10
When you are building an Immutable Object which of the following statements are true. I. Make the class final. II. Make the constructor private III. Don't provide methods that modify fields or objects referred to by fields. IV. Don't allow subclasses to override methods. V. Make all fields final and private.
Select the answer
1 correct answer
A.
Only I,III and V.
B.
Only III,IV and V.
C.
Only II,III and IV.
D.
Only III,IV.
E.
All of Above.

Quiz

2/10
Consider the following class: 1. public final class Program { 2. 3. final private String name; 4. 5. Program (String name){ 6. this.name = name; 7. 8. getName(); 9. } 10. 11. //code here 12. 13. } Which of the following code will make an instance of this class immutable.
Select the answer
2 correct answers
A.
public String getName(){return name;}
B.
public String getName(String value){ name=value; return value;}
C.
private String getName(){return name+"a";}
D.
public final String getName(){return name+="a";}
E.
All of Above.

Quiz

3/10
Consider the following class: 1. final class A{ 2. private String s; 3. public A(String s){ 4. this.s = s; 5. } 6. public String toString(){ return s; }; 7. public void setA(String a){ this.s+= a; }; 8. } 9. 10. public final class Immutable { 11. private final A a; 12. public Immutable(A a){ 13. this.a = a; 14. } 15. public String toString(){ return a.toString();}; 16. public static void main(String[] args){ 17. 18. A a = new A("Bye"); 19. Immutable im = new Immutable(a); 20. System.out.print(im); 21. 22. a.setA(" bye"); 23. System.out.print(im); 24. } 25. } What will be the result?
Select the answer
1 correct answer
A.
Bye bye
B.
Bye Bye
C.
ByeBye bye
D.
Compilation fail
E.
None of Above

Quiz

4/10
Consider the following class: 1. class A{ 2. public int method(){ return 0;} 3. } 4. 5. public class SubA extends A{ 6. //code here 7. } which of the following is a correct method overloading?
Select the answer
1 correct answer
A.
public int method(){ return 1;}
B.
public void method(){ }
C.
public int method() throws Exception { throw new FileNotFoundException(); }
D.
public int method(String s){ return 0;}

Quiz

5/10
Consider the following class: 1. class SuperClass{ 2. protected void method1(){ 3. System.out.print("M SuperC"); 4. } 5. } 6. 7. class SubClass extends SuperClass{ 8. private void method1(){ 9. System.out.print("M SubC"); 10. } 11. 12. public static void main(String[] args){ 13. SubClass sc = new SubClass(); 14. sc.method1(); 15. } 16. }
Select the answer
1 correct answer
A.
M SubC.
B.
M SuperC.
C.
M SuperCM SubC.
D.
Compilation fails.
E.
None of above.

Quiz

6/10
Given the following class: 1. // Code Here 2. @Override 3. public void run() { 4. for(int i = 0;i<10;i++) 5. System.out.print(i); 6. } 7. } 8. 9. public class Test { 10. public static void main(String args[]) { 11. Task t = new Task(); 12. Thread thread = new Thread(t); 13. thread.start(); 14. } 15. } Which of the following lines will give the result: 0123456789
Select the answer
1 correct answer
A.
class Task extends Runnable {
B.
class Task implements Runnable {
C.
class Task implements Thread {
D.
class Task extends Thread {
E.
None Of Above

Quiz

7/10
Given the following class: 1. public class Test { 2. public static void main(String args[]) { 3. //Code Here 4. Thread thread = new Thread(r); 5. thread.start(); 6. } 7. } Which of the following lines will give a valid Thread creation:
Select the answer
1 correct answer
A.
Thread r = () -> System.out.println("Running");
B.
Run r = () -> System.out.println("Running");
C.
Runnable r = () -> System.out.println("Running");
D.
Executable r = () -> System.out.println("Running");
E.
None Of Above

Quiz

8/10
Given the following class: 1. public class Test { 2. public static void main(String args[]) { 3. Runnable r2 = new Runnable() { 4. @Override 5. public void run() { 6. System.out.print("Running"); 7. } 8. }; 9. 10. Runnable r = new Runnable() { 11. @Override 12. public void run() { 13. System.out.print("Running1"); 14. Thread thread = new Thread(r2); 15. thread.start(); 16. } 17. }; 18. 19. System.out.print("Running2"); 20. Thread thread = new Thread(r); 21. thread.start(); 22. }; 23. } What will be the result?
Select the answer
1 correct answer
A.
Running2Running1Running
B.
RunningRunning1Running2
C.
RunningRunning1
D.
Running
E.
Compilation fails

Quiz

9/10
Given the following class: 1. public class Program { 2. 3. public static void main(String[] args){ 4. 5. Callable<String> c = new Callable<String>(){ 6. @Override 7. public String call() throws Exception { 8. String s=""; 9. for (int i = 0; i < 10; i++) { s+=i;} 10. return s; 11. } 12. }; 13. 14. ExecutorService executor = Executors.newSingleThreadExecutor(); 15. Future<String> future = executor.submit(c); 16. try { 17. String result = future.wait(); 18. System.out.println(result); 19. } catch (ExecutionException e) { 20. e.printStackTrace(); 21. } 22. } 23. } What will be the result?
Select the answer
1 correct answer
A.
0123456789
B.
12345678910
C.
Unhandled exception type InterruptedException al line 17
D.
The code will not compile because of line 5.
E.
The code will not compile because of line 17.

Quiz

10/10
Which of the followings are valid Executors factory methods I. ExecutorService es1 = Executors.newSingleThreadExecutor(4); II. ExecutorService es1 = Executors.newFixedThreadPool(10); III. ExecutorService es1 = Executors.newScheduledThreadPool(); IV. ExecutorService es1 = Executors.newScheduledThreadPool(10); V. ExecutorService es1 = Executors.newSingleThreadScheduledExecutor();
Select the answer
1 correct answer
A.
Only I, II, III.
B.
Only II, III, IV, V.
C.
Only I, IV, V.
D.
Only II, IV, V.
E.
All.
Looking for more questions?Buy now

Java-1Z0-809 Practice test unlocks all online simulator questions

Thank you for choosing the free version of the Java-1Z0-809 practice test! Further deepen your knowledge on Java Simulator; by unlocking the full version of our Java-1Z0-809 Simulator you will be able to take tests with over 420 constantly updated questions and easily pass your exam. 98% of people pass the exam in the first attempt after preparing with our 420 questions.

BUY NOW

What to expect from our Java-1Z0-809 practice tests and how to prepare for any exam?

The Java-1Z0-809 Simulator Practice Tests are part of the Java Database and are the best way to prepare for any Java-1Z0-809 exam. The Java-1Z0-809 practice tests consist of 420 questions and are written by experts to help you and prepare you to pass the exam on the first attempt. The Java-1Z0-809 database includes questions from previous and other exams, which means you will be able to practice simulating past and future questions. Preparation with Java-1Z0-809 Simulator will also give you an idea of the time it will take to complete each section of the Java-1Z0-809 practice test . It is important to note that the Java-1Z0-809 Simulator does not replace the classic Java-1Z0-809 study guides; however, the Simulator provides valuable insights into what to expect and how much work needs to be done to prepare for the Java-1Z0-809 exam.

BUY NOW

Java-1Z0-809 Practice test therefore represents an excellent tool to prepare for the actual exam together with our Java practice test . Our Java-1Z0-809 Simulator will help you assess your level of preparation and understand your strengths and weaknesses. Below you can read all the quizzes you will find in our Java-1Z0-809 Simulator and how our unique Java-1Z0-809 Database made up of real questions:

Info quiz:

  • Quiz name:Java-1Z0-809
  • Total number of questions:420
  • Number of questions for the test:85
  • Pass score:80%

You can prepare for the Java-1Z0-809 exams with our mobile app. It is very easy to use and even works offline in case of network failure, with all the functions you need to study and practice with our Java-1Z0-809 Simulator.

Use our Mobile App, available for both Android and iOS devices, with our Java-1Z0-809 Simulator . You can use it anywhere and always remember that our mobile app is free and available on all stores.

Our Mobile App contains all Java-1Z0-809 practice tests which consist of 420 questions and also provide study material to pass the final Java-1Z0-809 exam with guaranteed success. Our Java-1Z0-809 database contain hundreds of questions and Java Tests related to Java-1Z0-809 Exam. This way you can practice anywhere you want, even offline without the internet.

BUY NOW