UNIT-1
1) Which of the following option leads to the portability and security of Java?
a. Bytecode is executed by JVM
b. The applet makes the Java code secure and portable
c. Use of exception handling
d. Dynamic binding between objects
2) Which of the following is not a Java features?
a. Dynamic
b. Architecture Neutral
c. Use of pointers
d. Object-oriented
3) The \u0021 article referred to as a
a. Unicode escape sequence
b. Octal escape
c. Hexadecimal
d. Line feed
4) _____ is used to find and fix bugs in the Java programs.
a. JVM
b. JRE
c. JDK
d. JDB
5) Which of the following modifiers can be used for a variable so that it can be
accessed by any thread or a part of a program?
a. global
b. transient
c. volatile
d. default
6) If a thread goes to sleep
a. It releases all the locks it has.
b. It does not release any locks.
c. It releases half of its locks.
d. It releases all of its lock except one.
7)When does Exceptions in Java arises in code sequence?
a) Run Time
b) Compilation Time
c) Can Occur Any Time
d) None of the mentioned
8)Which of these keywords must be used to handle the exception thrown by try
block in some rational manner?
a) try
b) finally
c) throw
d) catch
9) Which of these statements is incorrect?
a) By multithreading CPU idle time is minimized, and we can take maximum
use of it
b) By multitasking CPU idle time is minimized, and we can take maximum use
of it
c) Two thread in Java can have the same priority
d) A thread can exist only in two states, running and blocked
10) What is multithreaded programming?
a) It’s a process in which two different processes run simultaneously
b) It’s a process in which two or more parts of same process run
simultaneously
c) It’s a process in which many different process are able to access same
information
d) It’s a process in which a single process can access information from many
sources
11) Which of these method of Thread class is used to find out the priority given
to a thread?
a) get()
b) ThreadPriority()
c) getPriority()
d) getThreadPriority()
12) Which of these method of Thread class is used to Suspend a thread for a
period of time?
a) sleep()
b) terminate()
c) suspend()
d) stop()
13) Which function of pre defined class Thread is used to check weather current
thread being checked is still running?
a) isAlive()
b) Join()
c) isRunning()
d) Alive()
14)Can command line arguments be converted into int automatically if
required?
a) Yes
b) No
c) Compiler Dependent
d) Only ASCII characters can be converted
15)How many arguments can be passed to main()?
a) Infinite
b) Only 1
c) System Dependent
d) None of the mentioned
16)Which of these is a correct statement about args in the following line of
code?
public static void main(String args[])
a) args is a String
b) args is a Character
c) args is an array of String
d) args in an array of Character