WorksheetsAssignment Quiz
Total questions: 47
Worksheet time: 33mins
Java is a
Procedure Oriented Language
Structure Oriented Language
Object_Oriented Language
Machine Language
The name of the following should be the file name in Java
Object Name
Variable Nam
Class Name
Array Name
Java program does not run without below function
user()
system()
main()
void()
A ___________ file is created after successful compilation of a Java program.
Object file
Array file
Class file
String file
JDK stands for
Java Developer Kit
Java Development Kit
Java Design Kit
Java Debugging Kit
What does JVM stands for?
Java Variable Machine
Java Virtual Machine
Java Virtual Mechanism
None of the above
Which of the following for loop declaration is not valid?
for ( int i = 99; i >= 0; i / 9 )
for ( int i = 7; i <= 77; i += 7 )
for ( int i = 20; i >= 2; - -i )
for ( int i = 2; i <= 20; i = 2* i )
What is the keyword "final" used for in Java?
identify a constant
identify an integer
identify a string
Identify a final answer
The keyword "method" is another name for
an object
a class
a function
a variable
Which of the following is incorrect?
int count = 50.0;
int salary = 50_000;
int salary = 50_00;
all of these are incorrect
The numeric type int uses how many bits?
31
32
63
64
The process by which objects of one class acquire the properties of objects of another class is known as
Polymorphism
Inheritance
Data Hiding
Association
Which from the following is a feature that allows us to perform a single action in different ways.
Abstraction
Polymorphism
Encapsulation
Inheritance
Attributes of an object are also known as
methods
properties
classes
functions
Name the data type: 1.0
double
int
char
boolean
Name the data type: '3'
int
char
String
None of the above
Which expression evaluates to true?
false == false
true != true
4 < 4
true == true != true
which of the following is wrapper class in java
Float
Integer
Double
all of above
which one of the following is true?
runnable interface declares the start method
Thread.start() method is used to move a thread from a new state to the runnable state
Thread.runnable() method is used to move a thread from new state to the runnable state
Thread.run() method is used to move a thread from new state to the runnable state
which of this class is used by character streams for reading data from buffer
BufferReader
InputStreamReader
FileReader
FileInputStream
What is the main difference between float and double data types?
4.1 is an example of float.
4.11 is an example of double.
Float consists of 8 bytes, and double consists of 4 bytes.
Float consists of 4 bytes, and double consists of 8 bytes.
In Java, execution starts from ___________ function.
get()
main()
java()
display()
How many ways a thread can be created in Java multithreading?
1
2
5
10
Which will contain the body of the thread in Java?
Start()
Run()
Main()
Execute()
The life cycle of a thread in java is controlled by
JRE
JDK
JVM
None
Which method is used to get current running thread object?
runningThread()
currentThread()
runnableThread()
None
In JAVA multi threading, a thread can be created by_______
Extending class
Implementing Runnable Interface
both
none
Q) Execution of a java thread begins on which method call?
Start ()
Run ()
Execute ()
Launch ()
which member of a class can be accessible by the class of another package?
public
private
defualt
protected
Choose the correct sequence.
Select Start -> Control Panel ->Environment Variables -> System Variables -> CLASSPATH
Select Start -> Control Panel ->system& security-> System -> Advanced -> Environment Variables -> System Variables -> CLASSPATH
Select Start -> Control Panel ->system& security-> System -> System Variables -> CLASSPATH
Select Start -> system& security-> System -> Advanced -> Environment Variables -> System Variables -> CLASSPATH
what is syntax to improt a particular class of package?
import class_name.*;
import package_name.*;
import pak1.pak2.pak3;
import packaage_name.class_name;
package types
user defined
built-in package
both
none
Collection of similar classes, interfaces and sub packages
variable
Interface
packages
class
The following example shows the creation of a
import java.applet.*;
import java.awt.*;
public class Main extends Applet{
public void paint(Graphics g){
g.drawString("Welcome in Java Applet.",40,20);
}
}
a. Banner using Applet
b. Basic Applet
c. Display clock
d. None of the above
Which of the following loops will execute the body of loop even when condition controlling the loop is initially false?
for
while
do..while
None of the above
Your full name
Your Reg No
