Font size
Worksheetsjava
Total questions: 50
Worksheet time: 25mins
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
What does the expression float a = 35 / 0 return?
0
Not a number
Infinity
Run time exception
Which of the following is a valid declaration of a char?
char ch = '\utea';
char ca = 'tea';
char cr = \u0223;
char cc = '\itea';
Evaluate the following Java expression, if x=3, y=5, and z=10:
++z + y - y + z + x++
24
23
20
25
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 )
Which of the following is not OOPS concept in Java?
Inheritance
Encapsulation
Polymorphism
Compilation
Which of the following is a type of polymorphism in Java?
Compile time polymorphism
Execution time polymorphism
Multiple polymorphism
Multilevel polymorphism
When does method overloading is determined?
At run time
At compile time
At coding time
At execution time
Which concept of Java is a way of converting real world objects in terms of class?
Polymorphism
Encapsulation
Abstraction
Inheritance
Which component is used to compile, debug and execute java program?
JVM
JDK
JIT
JRE
Which of the below is invalid identifier with the main method?
public
static
final
private
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
What is the extension of compiled java classes?
.java
.class
.txt
.js
Which of these keywords is used to make a class?
class
struct
int
none of the mentioned
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
Which of the following statements is correct?
Public method is accessible to all other classes in the hierarchy
Public method is accessible only to subclasses of its parent class
Public method can only be called by object of its class
Public method can be accessed by calling object of the public class
Which of this keyword must be used to inherit a class?
super
this
extend
extends
What is the keyword "final" used for in Java?
identify a constant
identify an integer
identify a string
Identify a final answer
Java was originally named:
Coffee
Oak
New C++
Duke
Which of the following is NOT a numeric data type
int
double
float
decimal
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
Which of the following is an example of a reference variable declaration?
int count;
String name;
float gpa;
char firstInitial;
Where does a java program start executing instructions from:
class
source file
main method
object
Java programs are ______
Translated
Compiled
Interpreted
Understood
________ & _________ are two types of java programs
Application
Applets
Operating System
System Software
(a) is java's interpreter.
(a) java package supports scanner classes
(a) java package supports math functions
Single Line Comments are initiated with (a)
Multiline comments are initiated with (a)
Documentation comments initiate with (a)
Who developed Java?
James Gosling
Bjarne Stroustrup
Robert James
None
JVM is responsible for machine to be platform independent.
TRUE
FALSE
What is Programming?
A city in Kansas
Communicating using the computer
Using the computer to execute a program
None Of The Above
Tick the Languages which Are Used In Coding?
English
Python
Java
Pythoñ
Which one of the following is correct ?
system.out.print
System.out.printl
System.Out.Print
System.out.print
a= 22 , b= 12 , c= a+b . What is c
33
35
48
34
The text inside the double quotes (including the double quotes) is
Double Quotes
String
Integer
Variable
