Java Programming 3
Questions Result & StatisticsQuiz-summary
0 of 20 questions completed
Questions:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
Information
Questions
Instruction:
- Total number of questions : 20
- Time allotted : 25 minutes.
- Each question carry 1 mark, no negative marks.
- Click the “Finish quiz” button given in bottom of this page to submit your answer.
- Test will be submitted automatically if the time expired.
- Don’t refresh the page.
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading...
You must sign in or sign up to start the quiz.
You have to finish following quiz, to start this quiz:
Results
Marks : 0 of 20 questions answered correctly | ||
Total number of questions | : | 20 |
Number of currect answered | : | 0 |
Your time | : |
|
Time has elapsed
You have reached 0 of 0 points, (0)
Categories
- Not categorized 0%
-
Thank you for submitting online test!
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- Answered
- Review
-
Question 1 of 20
1. Question
1 points.
Which function of predefined class Thread is used to check weather current thread being checked is still running?
CorrectAnswer : A
Explanation : isAlive() function is defined in class Thread, it is used for implementing multithreading.
IncorrectAnswer : A
Explanation : isAlive() function is defined in class Thread, it is used for implementing multithreading.
-
Question 2 of 20
2. Question
1 points.
What is the priority of the thread in output of this program?
class multithreaded_programing {
public static void main(String args[]) {
Thread t = Thread.currentThread();
t.setName(“New Thread”);
System.out.println(t.getName());
}
}
CorrectAnswer : C
Explanation : The getName() function is used to obtain the name of the thread, in this code the name given to thread is ‘New Thread’.
IncorrectAnswer : C
Explanation : The getName() function is used to obtain the name of the thread, in this code the name given to thread is ‘New Thread’.
-
Question 3 of 20
3. Question
1 points.
What is the name of the thread in output of this program?
class multithreaded_programing {
public static void main(String args[]) {
Thread t = Thread.currentThread();
System.out.println(t.getPriority());
}
}
CorrectAnswer : D
Explanation : The default priority given to a thread is 5.
IncorrectAnswer : D
Explanation : The default priority given to a thread is 5.
-
Question 4 of 20
4. Question
1 points.
What is the name of the thread in output of this program?
class multithreaded_programing {
public static void main(String args[]) {
Thread t = Thread.currentThread();
System.out.println(t.isAlive());
}
}
CorrectAnswer : A
Explanation : When you run the program the thread becomes active & code ‘t.isAlive’ returns true.
IncorrectAnswer : A
Explanation : When you run the program the thread becomes active & code ‘t.isAlive’ returns true.
-
Question 5 of 20
5. Question
1 pointsCorrectAnswer : A
No answer description.
IncorrectAnswer : A
No answer description.
-
Question 6 of 20
6. Question
1 pointsCorrectAnswer : A
No answer description.
IncorrectAnswer : A
No answer description.
-
Question 7 of 20
7. Question
1 points.
Which of the following is the correct syntax for suggesting that the JVM performs garbage collection
CorrectAnswer : D
No answer description.
IncorrectAnswer : D
No answer description.
-
Question 8 of 20
8. Question
1 points.
When method defined in subclass which has same signature as a method in a super class, it is known as method ________________
CorrectAnswer : B
No answer description.
IncorrectAnswer : B
No answer description.
-
Question 9 of 20
9. Question
1 points.
In an AWT or Swing container, BoxLayout places the components in which form?
left to right
top to bottom
right to left
bottom to top
CorrectAnswer : C
No answer description.
IncorrectAnswer : C
No answer description.
-
Question 10 of 20
10. Question
1 pointsCorrectAnswer : C
No answer description.
IncorrectAnswer : C
No answer description.
-
Question 11 of 20
11. Question
1 pointsCorrectAnswer : A
No answer description.
IncorrectAnswer : A
No answer description.
-
Question 12 of 20
12. Question
1 points.
When several threads act on object simultaneously and the result is reliable then it is known as ____________
CorrectAnswer : C
No answer description.
IncorrectAnswer : C
No answer description.
-
Question 13 of 20
13. Question
1 pointsCorrectAnswer : D
No answer description.
IncorrectAnswer : D
No answer description.
-
Question 14 of 20
14. Question
1 pointsCorrectAnswer : B
No answer description.
IncorrectAnswer : B
No answer description.
-
Question 15 of 20
15. Question
1 pointsCorrectAnswer : B
Explanation : Whenever the applet requires to redraw its output, it is done by using method paint().
IncorrectAnswer : B
Explanation : Whenever the applet requires to redraw its output, it is done by using method paint().
-
Question 16 of 20
16. Question
1 pointsCorrectAnswer : C
Explanation : drawString() method is defined in Graphics class, it is used to output a string in an applet.
IncorrectAnswer : C
Explanation : drawString() method is defined in Graphics class, it is used to output a string in an applet.
-
Question 17 of 20
17. Question
1 pointsCorrectAnswer : C
Explanation : AWT stands for Abstract Window Toolkit, it is used by applets to interact with the user.
IncorrectAnswer : C
Explanation : AWT stands for Abstract Window Toolkit, it is used by applets to interact with the user.
-
Question 18 of 20
18. Question
1 points.
Which of these modifiers can be used for a variable so that it can be accessed from any thread or parts of a program?
CorrectAnswer : B
Explanation : The volatile modifier tells the compiler that the variable modified by volatile can be changed unexpectedly by other part of the program. Specially used in situations involving multithreading.
IncorrectAnswer : B
Explanation : The volatile modifier tells the compiler that the variable modified by volatile can be changed unexpectedly by other part of the program. Specially used in situations involving multithreading.
-
Question 19 of 20
19. Question
1 pointsCorrectAnswer : C
No answer description.
IncorrectAnswer : C
No answer description.
-
Question 20 of 20
20. Question
1 points.
What is the Message is displayed in the applet made by this program?
import java.awt.*;
import java.applet.*;
public class myapplet extends Applet {
public void paint(Graphics g) {
g.drawString(“A Simple Applet”, 20, 20);
}
}
CorrectAnswer : A
No answer description
IncorrectAnswer : A
No answer description