JOIN ADRE 2.0 Telegram Group

Packages and Interfaces - Core Java MCQ Questions and Answers - Exam Quiz

Questions
6 TreeMap class is used to implement which one of the following collection interfaces?
A Set
B SortedSet
C SortedMap
D List

Answer: Option [B]

TreeMap class is used to implement SortedMap.

7 Which of the following is the correct syntax for suggesting that the JVM performs garbage collection?
A System.free()
B System.setGarbageCollection()
C Syste.out.gc()
D System.gc()

Answer: Option [D]

System.gc() is a program that runs for garbage collection. But it not reliable.

Advertisement
ADRE 2.0 Mock Test - 5 Start Test
ADRE 2.0 Mock Test - 5 Start Test

DOWNLOAD CURRENT AFFAIRS PDF FROM APP

8 For which purpose packages are used in Java?
A Categorizes data
B Organizing java classes into namespaces
C For faster compilation
D None of these

Answer: Option [B]

Java packages resolves the name conflicts among different classes.

9 The first statement in java source file
A import statement
B package statement
C main statement
D try{} and catch{}

Answer: Option [B]
10 A package is a collection of
A classes
B interfaces
C editing tools
D classes and interfaces

Answer: Option [D]

A package is a collection of classes, methods and interfaces.

ADRE 2.0 MOCK TEST

Take Mock Tests

Government Schemes Mock Test Start Test!
Political Science Mock Test – 42 Start Test
History Test – 190 Start Test
Quantitative Aptitude Test Start Test!
Trigonometry - Mock Test Start Test!
Data Interpretation - Mock Test Start Test!
General Awareness - Mock Test Start Test!
Reasoning Ability - Mock Test Start Test!
Englist(Antonyms) Mock Test 1 Start Test!
Quantitative Aptitude (Percentage) Mock Test Start Test!
Economy Mock Test 1 Unlock Test!
Books & Authors - Test 2 Unlock Test!

Chapters

Advertisement