Java Programming 4
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.
What is the length of the application box 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
Explanation : The code in pain() method – g.drawString(“A Simple Applet”,20,20); draws a applet box of length 20 and width 20.
IncorrectAnswer : A
Explanation : The code in pain() method – g.drawString(“A Simple Applet”,20,20); draws a applet box of length 20 and width 20.
-
Question 2 of 20
2. Question
1 pointsCorrectAnswer : D
No answer description.
IncorrectAnswer : D
No answer description.
-
Question 3 of 20
3. Question
1 pointsCorrectAnswer : B
Explanation : whenever a subclass needs to refer to its immediate superclass, it can do so by use of the keyword super.
IncorrectAnswer : B
Explanation : whenever a subclass needs to refer to its immediate superclass, it can do so by use of the keyword super.
-
Question 4 of 20
4. Question
1 pointsCorrectAnswer : B
Explanation : A class member declared protected becomes private member of subclass.
IncorrectAnswer : B
Explanation : A class member declared protected becomes private member of subclass.
-
Question 5 of 20
5. Question
1 pointsCorrectAnswer : C
No answer description.
IncorrectAnswer : C
No answer description.
-
Question 6 of 20
6. Question
1 pointsCorrectAnswer : C
Explanation : private members of a class cannot be inherited by a sub class.
IncorrectAnswer : C
Explanation : private members of a class cannot be inherited by a sub class.
-
Question 7 of 20
7. Question
1 pointsCorrectAnswer : C
No answer description.
IncorrectAnswer : C
No answer description.
-
Question 8 of 20
8. Question
1 points.
Which of these is a mechanism for naming and visibility control of a class and its content?
CorrectAnswer : B
Explanation : Packages are both naming and visibility control mechanism. We can define a class inside a package which is not accessible by code outside the package.
IncorrectAnswer : B
Explanation : Packages are both naming and visibility control mechanism. We can define a class inside a package which is not accessible by code outside the package.
-
Question 9 of 20
9. Question
1 points.
Which of this access specifies can be used for a class so that its members can be accessed by a different class in the same package?
CorrectAnswer : D
Explanation : Either we can use public, protected or we can name the class without any specifier.
IncorrectAnswer : D
Explanation : Either we can use public, protected or we can name the class without any specifier.
-
Question 10 of 20
10. Question
1 points.
Which of these access specifiers can be used for a class so that it’s members can be accessed by a different class in the different package?
CorrectAnswer : A
No answer description.
IncorrectAnswer : A
No answer description.
-
Question 11 of 20
11. Question
1 pointsCorrectAnswer : C
Explanation : Operator * is used to import the entire package.
IncorrectAnswer : C
Explanation : Operator * is used to import the entire package.
-
Question 12 of 20
12. Question
1 pointsCorrectAnswer : D
Explanation : A package can be renamed only after renaming the directory in which the classes are stored.
IncorrectAnswer : D
Explanation : A package can be renamed only after renaming the directory in which the classes are stored.
-
Question 13 of 20
13. Question
1 pointsCorrectAnswer : B
No answer description.
IncorrectAnswer : B
No answer description.
-
Question 14 of 20
14. Question
1 points.
What is the output of this program?
package pkg;
class output {
public static void main(String args[])
{
StringBuffer s1 = new StringBuffer(“Hello”);
s1.setCharAt(1, x);
System.out.println(s1);
}
}
CorrectAnswer : C
No answer description.
IncorrectAnswer : C
No answer description.
-
Question 15 of 20
15. Question
1 points.
What is the output of this program?
package pkg;
class output {
public static void main(String args[])
{
StringBuffer s1 = new StringBuffer(“Hello World”);
s1.insert(6 , “Good “);
System.out.println(s1);
}
}
CorrectAnswer : D
Explanation : Since output.class file is not in the directory pkg in which class output is defined, program will not be able to run.
IncorrectAnswer : D
Explanation : Since output.class file is not in the directory pkg in which class output is defined, program will not be able to run.
-
Question 16 of 20
16. Question
1 pointsCorrectAnswer : A
No answer description.
IncorrectAnswer : A
No answer description.
-
Question 17 of 20
17. Question
1 pointsCorrectAnswer : D
No answer description.
IncorrectAnswer : D
No answer description.
-
Question 18 of 20
18. Question
1 pointsCorrectAnswer : B
Explanation : Whenever a subclass needs to refer to its immediate superclass, it can do so by use of the keyword super.
IncorrectAnswer : B
Explanation : Whenever a subclass needs to refer to its immediate superclass, it can do so by use of the keyword super.
-
Question 19 of 20
19. Question
1 pointsCorrectAnswer : D
No answer description.
IncorrectAnswer : D
No answer description.
-
Question 20 of 20
20. Question
1 pointsCorrectAnswer : B
Explanation : Strings in Java are immutable that is they can not be modified.
IncorrectAnswer : B
Explanation : Strings in Java are immutable that is they can not be modified.