You want to restrict object creation to only one instance in a class. Which pattern will you use?
Anonymous Poll
5%
Factory
76%
Singleton
12%
Builder
7%
Prototype
For career growth as a fresher, what’s most helpful?
Anonymous Poll
21%
Having a mentor
27%
Networking with seniors
6%
Attending workshops
46%
Self-learning & practice
What will be the default value of a boolean variable in a Java class?
Anonymous Poll
27%
true
58%
false
14%
null
0%
Compiler Error
Which of the following is not a valid access modifier in Java?
Anonymous Poll
2%
public
6%
private
2%
protected
90%
extern
1
You have an array of numbers and want to print only even numbers. Which approach is correct?
Anonymous Poll
85%
Use for loop and check num % 2 == 0
2%
Use if num = 2
8%
Use while num % 2
5%
Use switch-case
You are reading a file but it may not exist. What should you do?
Anonymous Poll
4%
Ignore the error
36%
Use try-catch
58%
Use if file.exists() only
2%
Program will automatically handle it
You want to store multiple unique values in Java. Which collection is best?
Anonymous Poll
31%
ArrayList
56%
HashSet
13%
LinkedList
0%
Queue
1
You are writing a loop but want to skip the current iteration. Which keyword should you use?
Anonymous Poll
36%
break
58%
continue
5%
exit
1%
stop
You declared a variable inside a loop. Can you access it outside the loop?
Anonymous Poll
78%
No, it’s limited to loop scope
11%
Yes, it’s accessible everywhere
9%
Only if it’s static
3%
Depends on JVM version
1
You forgot to close a file after reading it in Java. What can happen?
Anonymous Poll
40%
Memory leak or resource lock
21%
Nothing will happen
4%
Compilation error
36%
JVM closes it automatically
You are using Scanner for input but your program is stuck. Why might this happen?
Anonymous Poll
25%
Infinite loop
45%
Waiting for input
22%
Syntax error
8%
JVM crash
1
What is the default value of a local variable in Java?
Anonymous Poll
40%
No default value
38%
0
22%
null
0%
false
Which collection allows null keys and null values in Java?
Anonymous Poll
64%
HashMap
17%
Hashtable
9%
TreeMap
10%
ConcurrentHashMap
What will happen if you call Thread’s start() method twice?
Anonymous Poll
29%
Thread runs twice
29%
Restarts the same thread
41%
Throws IllegalThreadStateException