Font size
WorksheetsJava Basics
Total questions: 81
Worksheet time: 41mins
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 is
Interpreted
Compiled
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
Command to compile Java program
javax
javay
javac
Java
Command to run a Java program
javaa
java
jaava
jaavaa
JDK stands for
Java Developer Kit
Java Development Kit
Java Design Kit
Java Debugging Kit
JRE stands for
Java Run Environment
Java Run Execution
Java Runtime Environment
Java Ready Execution
Java is
Machine dependent language
Machine independent language
Which component is used to compile, debug and execute java program?
JVM
JDK
JRE
JIT
Which component is responsible for converting bytecode into machine specific code
JVM
JDK
JRE
JIT
Which component is responsible to run java program
JVM
JDK
JRE
JIT
What is the extension of compiled java classes
.classs
.java
.txt
.js
What is use of interpreter
They convert bytecode to machine language code
They read high level code and execute them
They are intermediated between JIT and JVM
It is a synonym for JIT
Which of the following option leads to the portability and security of Java?
Bytecode is executed by JVM
The applet makes the Java code secure and portable
Use of exception handling
Dynamic binding between objects
Which of the following is not a Java features?
Dynamic
Architecture Neutral
Use of pointers
Object-oriented
_____ is used to find and fix bugs in the Java programs.
JVM
JRE
JDK
JDB
Which of the following tool is used to generate API documentation in HTML format from doc comments in source code?
javap tool
javaw command
Javadoc tool
javah command
Java is ______________________
Object based
Object Oriented
fully object oriented
procedural
Java was developed by
James gosling
John gosling
James frank
John frank
JDK stands for (a)
JVM stands for (a)
List out oops concept.
Int data types represents _______ bits.
8
16
32
64
There are (a) types of data types.
(a) is a piece of memory that can contain a data value.
How many types of array?
1
2
3
4
List out types of inheritance.
Single
Mulitple
Multi level
Hierarchy
Which one of the following is escape sequences?
\r
\n
\f
\t
Which statement is true about java ?
Java is a sequence-depended programming language
Java is a code dependent programming language
Java is a platform-dependent programming language
Java is a platform-independent programming language
Which component is used to compile,debug and execute the java programs ?
JRE
JIT
JDK
JVM
Which one of the following is not a java feature
Object-oriented
Use of pointers
Portable
Dynamic and Extensible
Which of these cannot be used for a variable name in java ?
Identifier & keyword
Identifier
Keyword
None of the mentioned
Which of the following is not an OOPS concept in java ?
Polymorphism
Inheritance
Compilation
Encapsulation
Which of these are selection statements in java
Break
Continue
For ( )
If ( )
Which of these keywords is used to define interfaces in java
intf
Intf
interface
Interface
Which of the following is a superclass of every class in java ?
ArrayList
Abstract class
Object class
String
Which of these packages contains the exception stack Overflow in java ?
Which of these statements is incorrect about tread ?
Start() method is used to begin execution of the thread
Run () method is used to begin execution of a thread before start() method in special cases
A thread can be formed by implementing runnable interface only
A thread can be formed by a class that extends thread class
Which of these keywords are used for the block to be examined for exceptions ?
Check
Throw
Catch
Try
Which one of the following is not an access modifier ?
Protected
Void
Public
Private
What is the numerical range of a char data tupe in java ?
0 to 256
-128 to 127
0 to 65535
0 to 32767
When does method overloading is determined?
At run time
At compile time
At coding time
At execution time
When overloading does not occur ?
More than one method with same name but different method signature and different number or type of parameters
More than one method with same name,same signature but different number of signature
More than one method with same name,same signature,same number of parameters but different type
More than one method with same , same number of parameters and type but different signature
What is it called if an object has its own life cycle and there is no owner
Aggregation
Composition
Encapsulation
Association
Method overriding is combination of inheritance and polymorphism ?
True
False
Which of the below is invalid identifier with the main method
Public
Static
Private
Final
How can we identify whether a compilation unit is class or interface from a .class file ?
Java source file header
Extension of compilation unit
We cannot different between class and interface
The class or interface name should be postfixed with unit type
What is use of interpreter ?
They covert bytecode to machine language code
They read high level code and execute them
They are intermediated between JIT and JVM
It is a synonym for JIT
Which of the following is a type of polymorphism in Java?
Compile time polymorphism
Execution time polymorphism
Multiple polymorphism
Multilevel polymorphism
Which component is used to compile, debug and execute java program?
JVM
JDK
JIT
JRE
Syntax to compile java program from command prompt
java Filename.java
javac Filename
javac Filename.java
java Filename
Which component is responsible for converting bytecode into machine specific code?
JVM
JDK
JIT
JRE
Which of the following is not a valid Java comment?
/** Comment 1 */
*/ Comment 2 /*
// Comment 3
/* Comment 4 */
When saving a Java source file, save it with an extension of
.java.
.javac.
.src.
.class.
Which of the following is not a rule that must be followed when naming identifiers?
After the first character, you may use the letters a-z, A-Z, an underscore, a dollar sign, or digits 0-9.
Identifiers can contain spaces.
Uppercase and lowercase characters are distinct.
The first character must be one of the letters a-z, A-Z, an underscore or a dollar sign.
To print "Hello, world" on the monitor, use the following Java statement:
System.out.println("Hello, world");
System Print = "Hello, world";
SystemOutPrintln('Hello, world');
system.out.println{Hello, world};
Which of this keyword must be used to inherit a class?
super
this
extend
extends
Which of these statement is incorrect?
Every class must contain a main() method
Applets do not require a main() method at all
There can be only one main() method in a program
main() method must be made public
What is the extension of compiled java classes?
.java
.class
.txt
.js
Where does a java program start executing instructions from:
class
source file
main method
object
Which of these keywords is used to make a class?
class
struct
int
none of the mentioned
Which of the following is a type of polymorphism in Java?
Compile time polymorphism
Execution time polymorphism
Multiple polymorphism
Multilevel polymorphism
Which of the following is not OOPS concept in Java?
Inheritance
Encapsulation
Polymorphism
Compilation
Which company owns Java?
Oracle
Microsoft
Apple
Intel
Who invented Java?
James Gosling
Sergey Brin
Steve Jobs
Bill Gates
Tim Berners-Lee
Java was originally named:
Coffee
Oak
New C++
Duke
Java has (a) primitive data types.
JDK stands for (a)
List out oops concept.
Java is ___________.
Structured Programming Language
Object Oriented Programming Language
Query Language
None of the above
________ keyword is used to monitor an exception.
try
catch
throw
throws
Java was developed by
James gosling
John gosling
James frank
John frank
Java does not support
Single Inheritance
Multiple Inheritance
Multilevel Inheritance
Hierarchical Inheritance
Which one of the following is escape sequences?
\r
\n
\f
\t
Java is
Simple
Object Oriented
Platform dependent
interpreted
What will be the output?
24
32
23
31
a
b
c
d
