Java is one of the most popular and widely used programming languages, and Java is an object oriented programming language. It helps in creating any kind of programming and is usable. Java helps in Android development and backend development. If you are preparing for Java interview, technical aptitude test and competitive programming exams then our blog can help you very well. So in this PrepDroid blog, we have provided you Java Aptitude MCQ Questions with Answers which will help you in any upcoming Java interview preparation and Java aptitude test.
1. Which of the following is not a feature of Java?
- A) Platform Independence
- B) Object-Oriented
- C) Compiler Independent
- D) Multithreading
2. Which of these data types is used to store 64-bit floating point numbers in Java?
A) float
B) double
C) long
D) int
3. What is the size of an int variable in Java?
- A) 8 bits
- B) 16 bits
- C) 32 bits
- D) 64 bits
4. Which keyword is used to prevent a class from being inherited in Java?
- A) static
- B) final
- C) private
- D) abstract
5. What will happen if you try to compile and run the following code?
int x = 5;
System.out.println(x++);
System.out.println(x);
- A) 5 and 5
- B) 6 and 6
- C) 5 and 6
- D) Compilation error
6. What is the output of the following code?
String s = "Java";
s.concat("Programming");
System.out.println(s);
- A) Java
- B) Java Programming
- C) JavaProgramming
- D) Compilation error
7. Which method is used to create a new thread in Java?
- A) start()
- B) run()
- C) execute()
- D) launch()
8. How can you join two Strings together in Java?
- A) +
- B) &
- C) *
- D) =
9. Which collection in Java maintains insertion order?
- A) HashSet
- B) TreeSet
- C) LinkedHashSet
- D) PriorityQueue
10. Which of the following is used to handle exceptions in Java?
- A) finalize
- B) throw
- C) catch
- D) try-catch
11. In Java, which access modifier makes a member accessible only within its own package?
- A) public
- B) private
- C) protected
- D) default
12. What does the term “JIT compiler” refer to in Java?
- A) Just In Time compiler
- B) Java Internal Translator
- C) Java Information Technology
- D) Java In Time compiler
13. Which keyword is used in Java to inherit a class?
- A) extends
- B) implements
- C) inherits
- D) imports
14. Which method of the Object class is used to create a copy of an object?
- A) copy()
- B) clone()
- C) duplicate()
- D) get()
15. Which of the following is a valid way to create an array in Java?
- A) int arr[] = new int(5);
- B) int arr[] = new int[5];
- C) int arr[] = new int[];
- D) int arr() = new int[5];
Also Prepare: 30 Android Development Interview Questions (MCQs) with Answers – Prepare for Your Next Interview
2 thoughts on “Java Aptitude MCQ Questions with Answers for Freshers”