Java is one of the most popular programming language and platform. Java is fast, reliable and secure.
Java is a high level, robust, object-oriented and secure programming language. Java was originally developed by Sun Microsystems (which is now the subsidiary of Oracle) in the year 1995. James Gosling is known as the father of Java. Before Java, its name was Oak. Since Oak was already a registered company, so James Gosling and his team changed the name from Oak to Java.
As of September 2023, Java 19 is the latest version, while Java 17, 11 and 8 are the current long-term support (LTS) versions.
MCQs for Java Programming – Questions and Answers
1. Who founded Java Programming?
a) Guido van Rossum
b) James Gosling
c) Dennis Ritchie
d) Bjarne Stroustrup
2. What part is used to compile, debug and execute java programs?
a) JRE
b) JIT
c) JDK
d) JVM
3. What difference does it make when java is out of memory?
a) MemoryError
b) OutOfMemoryError
c) MemoryOutOfBoundsException
d) MemoryFullException
4. Which of these selection statements in Java do you have?
a) a break
b) continue
c) for ()
d) if ()
5. Which of these keywords is used to define interfaces in Java?
a) intf
b) Intf
c) interface
d) Interface
6. Which of the following is the superclass of all Java classes?
a) Array List
b) Abstract Class
c) Object class
d) String
7. Which of the following is not a Java Profiler?
a) JProfiler
b) Eclipse Profile
c) JVM
d) JConsole
8. Which of these packages contains the stack overflow variant in Java?
a) java.io
b) java.system
c) java.lang
d) java.util
9. Which of these statements are wrong about Thread?
a) start () method is used to start a thread function
b) run () method is used to start a thread process before start the () method in special cases
c) The thread can be created using only the runnable interface
d) The thread can be made of a class that extends to the Thread class
10. Which of these keywords is used to block an exception?
a) check
b) throw
c) catch
d) try
Are you aspiring for a booming career in IT? If YES, then dive in |
||
Full Stack Developer Course |
Python Programming Course |
Data Science and Machine Learning Course |
11. Which of the following is not an access modifier?
a) Protected
b) Void
c) Public
d) Confidential
12. What is the range for the type of char data in Java?
a) 0 to 256
b) -128 to 127
c) 0 to 65535
d) 0 to 32767
13. Which section provides for the implementation of the private server side of the system?
a) Server
b) ServerReader
c) Socket
d) ServerSocket
14. Which of the following is true of servers?
a) Resources can use the full functionality of Java class libraries
b) The resources operate within the web server’s domain, private domain and use the functionality of the java category libraries
c) Applications run within the web server address area
d) The servlets are independent in one place because they are labeled with java
15. What is the expansion of the compiled java classes?
a) .txt
b) .js
c) .class
d) .java
16. Arrays in java are-
a. Object References
b. Objects
c. Primitive Data type
d. None
17. Total constructor string class have?
a. 3
b. 7
c. 13
d. 20
18. Where does the system stores parameters and local variables whenever a method is invoked?
b. Stack
c. Array
d. Tree
19. When is the finalize() method called?
a. Before Garbage Collection
b. Before an object goes out of scope
c. Before a variable goes out of scope
d. None
b. Interface
c. Class
d. Method
Java Programming MCQ Questions and Answers – Download PDF
Be it playing games, withdrawing money from ATMs, or shopping online or booking a plane ticket; Java code is helpful for all of these activities. Java is a strong and secure language and that is what makes it a favorite for developers to do such projects. Being able to write code in Java opens the door to many opportunities. So configure and try these projects to build your profile in Java.
Related Articles
Our Other Courses | ||
MEP Course | Quantity Surveying Course | Montessori Teachers Training Course |
Performance Marketing Course | Practical Accounting Course | Yoga Teachers Training Course |