Java Basics Quiz May 20, 2021 Leave a Comment on Java Basics Quiz Welcome to your Java Basics Quiz. You are attempting quiz on May 20, 2022. For your information, please note that this Java Basics Quiz has only single choice questions. Read each and every questions carefully before you start answering. You will have 10 min to complete the quiz. Press the Start quiz button to initiate the quiz. Once complete you press Finish button to complete the test. After completion of test you can see your quiz result with sharing option, You can share your quiz result to social media like Facebook, Instagram etc. Note: You can view all the answers at the end of this quiz. Best of luck for LTE Java Basics Quiz 1 What happens if constructor of class A is made private? Any class can instantiate objects of class A Inherited class can instantiate objects of class A Objects of class A can be instantiated only within the class where it is declared Classes within the same package as class A can instantiate objects of class A 2 Which of these are types multitasking? Process based None Process and Thread based Thread based 3 Which of the following will ensure the thread will be in running state? yield() notify() Thread.killThread() wait() 4 Which of these keywords are used to implement synchronization? synchronized synchronize syn synch 5 Map Implements collection interface? False True May Be 6 What is these keywords must be used to inherit a class? extends this super extent 7 Which component is responsible for converting bytecode into machine specific code? JDK JRE JIT JVM 8 Which of these access specifiers must be used for main() method protected public private None 9 What will happen of two thread of same priority are called to be processed simultaneously? Both of them will be executed None of them will be executed It is dependent on the operating system Anyone will be executed first lexographically 10 Which of the following is a correct constructor for the thread? Thread (Runnable a, ThreadGroup t) Thread (Runnable a, int priority) Thread(Runnable a, String str) Thread (int priority) 11 Which of these method is used to reduce the capacity of an ArrayList Object trimTosize() trimToSize() trim() trimSize() 12 How to sort the elements of ArrayList? Sorter.sortAsc(listObj) listObj.sort() Collection.sort(lsitObj) Collection.sort(listObj) 13 Is hashmap an ordered collection? True False 14 What is the use of Interpreter? They read high level code and execute them They are intermediate between JIT and JVM It is a synonyms of JIT They convert bytecode to machine language code 15 Which of these data types is used by operating system to manage the Recursion in java? Queue Tree Array Stack 16 Which of these method waits for the thread to terminate? stop() isAlive sleep() join() 17 Which of the below does not implement Map Interface ? EnumMap Hashtable HashMap Vector 18 Which of the below is not a memory leak solution? JVM parameter tuning Process restart GC Parameter tuning Code changes Please fill in the comment box below.