Welcome to your JAVA SET - 3 1. How can we access methods for file handling in java? Java.io.File Java.files Java.io Java.FileHandling None 2. Which of the following is the correct syntax to create a variable in Java? var name; var name int; int name; All of these None 3. Which of the following ways is the correct way to create an object in Java? Using the new keyword Using newInstance() method clone() method All of these None 4. Given that Student is a class, how many reference variables and objects are created by the following code? Three reference variables and two objects are created. Two reference variables and two objects are created. One reference variable and two objects are created. Three reference variables and three objects are created. None 5. What is a set in Java? Used to store key-value pairs Primary structures Represented in the form of values All of these None 6. What does the expression float a = 35 / 0 return? Not a Number Infinity 0 Run time exception None 7. What will be the output of following Java code? {3 =C, 4 =C++, 5 =Ruby, 6 =null, 10 =Java} {10 =Java, 3 =C, 4 =C++, 6 =null, 5 =Ruby} {10 =Java, 6 =null, 5 =Ruby, 4 =C++, 3 =C} None of these None 8. Which of the given methods are of Object class? wait( long msecs ), interrupt(), and notifyAll() notify(), wait( long msecs ), and synchronized() notify(), notifyAll(), and wait() sleep( long msecs ), wait(), and notify() None 9. What will be the output of following Java code? Hello Bye Error All of these None 10. Which of the following is a valid syntax to synchronize the HashMap? Map m = hashMap.synchronizeMap(); HashMap map =hashMap.synchronizeMap(); Map m2 = Collection.synchronizeMap(hashMap); Map m1 = Collections.synchronizedMap(hashMap); None 11. Null in Java is ___. Reserved keyword Used in exception handling Literal value All of these None 12. What is file handling in java? It is creating, deleting, and modifying files using a java program. Creating new method Filing method to different file to extract them better All of these None 13. Batch processing in java is ___. Used to execute a group of queries or a batch as executing a single query, again and again, is time taking and reduce the performance Used to processing multiple queries can be executed at once Used to increase program's performance All of these None 14. Wrapper class in java is ___. Used to encapsulate primitive data types Declare new classes called wrapper Create a new instance of the class None of these None 15. Method used to take a string as input in Java? next() nextLine() Both A. and B. None of these None 16. What is a map in Java? Data structure Defined in java.util package Represented using key-value pairs All of these None 17. Which of these is a type of variable in Java? Instance Variable Local Variable Static Variable All of these None 18. "Evaluate the following Java expression, if x=3, y=5, and z=10: ++z + y - y + z + x++" 24 23 20 25 None 19. Which of the following is a valid long literal? ABH8097 L990023 0xnf029L 904423 None 20. Which of the following sorts the elements were inserted? Hashtable Map None of these Array None 21. Enumeration in Java is ___. Data type which contains fixed set of constants Method Class None of these None 22. Abstract class is ___. Needs to be inherited to be used Contains only abstract method Created using abstract keyword All of these None 23. What is the use of \w in regex? Used for a non-whitespace character Used for a whitespace character Used for a non-word character Used for a word character None 24. What will be the output of the following program? 15 times +++++ 8 times *** and 7 times +++++ Both will print only once 15 times *** None 25. Boxing is ___. Creating object Converting primitive type of object instance Creating new box All of these None Share this:TweetEmailTelegramPrintWhatsAppLike this:Like Loading... Related Posts (You May Also Read):