WorksheetsIPT-QUIZ1
Total questions: 65
Worksheet time: 47mins
Java was originally named:
Coffee
Oak
New C++
Duke
From where did Java get its name?
Coffee
Book
TV Programme
Initials of the developers of Java
Is Android based on Java?
True
False
When was Java released?
1975
1985
1995
2005
2015
Who invented Java?
James Gosling
Sergey Brin
Steve Jobs
Bill Gates
Tim Berners-Lee
What is the name of the Java mascot?
Duke
Ronny
Penguin
James
Jack
Which company owns Java?
Oracle
Microsoft
Apple
Intel
which of the following is wrapper class in java
Float
Integer
Double
all of above
which one of the following is a legal decelration of a two- dimensional array of integers
int[] a[] = new int[5][];
int[5][5] a = new int[][];
int a = new int[5,5];
int[][] a = new int[][5];
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 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
Which of the following is NOT a data types in java
int
String
number
double
What is right way of defining String variable?
String name = "John";
String name = "John"
String name = John;
String name "John";
float myFloatNum = 5.99f;
System.out.println(myFloatNum);
What will be the output?
5.99
5.99f
"5.99"
"5.99"f
int x = 5;
int y = 6
int z = 50;
System.out.println(x + y + z);
What will be the output?
61
5650
66
x + y + z
Based on, the general rules for constructing names for variables.
Pick false statement.
Names can contain letters, digits, underscores, and dollar signs.
Names are NOT case sensitive
Reserved words (like Java keywords, such as int or String) cannot be used as names
Names can also begin with $ and _
Which of the following is NOT a NON-primitive data type
String
Array
double
class
which of the following is NOT a primitive data type?
byte
array
char
boolean
Which of the following is the right way of defining char variable?
char myGrade = 'B';
char myGrade = "B";
char myGrade 'B';
char myGrade = "B"
int sum1 = 100 + 50;
int sum2 = sum1 + 250;
int sum3 = sum2 + sum2;
System.out.println(sum3);
What will be the final output?
950
800
sum2sum2
sum1250
Which of the following is assignment operator?
==
=
=+
++
int x = 10;
x = x + 5;
System.out.println(x);
What will be the output?
15
5
55
x5
x /= 3
Which of the below statements matches with above statement?
x = 3 / x
x = x / 3
x / 3
x /x = 3
int x = 4;
System.out.println(x < 5 && x < 10);
What will be the output?
false
true
4
x < 5 && x < 10
int x = 4.4;
int y = 5.5;
System.out.println(x == y);
What will be the output?
4.4
true
false
5.5
What is the output of below code?
int x = 5;
System.out.println(x++);
System.out.println(x);
5
5
6
6
5
6
6
5
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 is a valid declaration of a char?
char ch = '\utea';
char ca = 'tea';
char cr = \u0223;
char cc = '\itea';
What does the expression float a = 35 / 0 return?
0
Not a number
Infinity
Run time exception
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 concept of Java is achieved by combining methods and attribute into a class?
Encapsulation
Inheritance
Polymorphism
Abstraction
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
