Java Programming MCQ
Java Programming MCQ
Total Questions: 30
you'll have 25 second to answer each question.
Quiz Result
Total Questions:
Attempt:
Correct:
Wrong:
Percentage:
Quiz Answers
1. Who invented Java Programming?
James Gosling
2. Which component is used to compile, debug and execute the java programs?
JDK
3. Which statement is true about Java?
Java is a platform-independent programming language
4. Which one of the following is not a Java feature?
Use of pointers
5. What is the extension of java code files?
.java
6. Which of the following is not an OOPS concept in Java?
Compilation
7. What is the extension of compiled java classes?
.class
8. Which one of the following is not an access modifier?
Void
9. Which of these operators is used to allocate memory to array variable in Java?
new
10. Which of these is an incorrect array declaration?
int arr[] = int [5] new
11. What is the return type of Constructors?
none of the mentioned
12. Which function is used to perform some action when the object is to be destroyed?
finalize()
13. When does method overloading is determined?
At compile time
14. What is it called where child object gets killed if parent object is killed?
Composition
15. What does AWT stands for?
Abstract Window Toolkit
16. Which of these is a type of stream in Java?
Byte stream
17. Which of these is used to read a string from the input stream?
read()
18. Which of these class contains the methods print() & println()?
PrintStream
19. Which of these functions is called to display the output of an applet?
paint()
20. Which of these operators can be used to get run time information about an object?
instanceof
21. Which of these access specifiers can be used for an interface?
Public
22. Which of these keywords is used by a class to use an interface defined previously?
implements
23. What is multithreaded programming?
It’s a process in which two or more parts of same process run simultaneously
24. Thread priority in Java is?
Integer
25. What will happen if two thread of the same priority are called to be processed simultaneously?
It is dependent on the operating system
26. Which of these packages contains abstract keyword?
java.lang
27. Which keyword is used by the method to refer to the object that invoked it?
this
28. What is the value returned by function compareTo() if the invoking string is less than the string compared?
value less than zero
29. What will be the output of the following Java code?
class output {
public static void main(String args[]) {
String c = "Hello i love java";
boolean var;
var = c.startsWith("hello");
System.out.println(var); } }
false
30. What is the Message is displayed in the applet made by the following Java program?
import java.awt.*;
import java.applet.*;
public class myapplet extends Applet {
public void paint(Graphics g) {
g.drawString("A Simple Applet", 20, 20); } }
A Simple Applet
No comments:
Post a Comment