Font size
WorksheetsLibrary Classes
Total questions: 114
Worksheet time: 1hrs 14mins
Which key word allocates memory dynamically during object creation.
(a)
Write a java statement to create an object named Galaxy of Samsung class.
(a)
Creating an object of a class is said to be -------------
(a)
Write a java statement to import Scanner class
(a)
An object is also called an (a) of the class.
Character is a (a) class
(a) is a blue print of an object.
Which is known as object factory?
(a)
State the package that contains the class Scanner
(a)
int x=5;
x+=x++;
System.out.println(x);
Write the output
(a)
Bluej is a __ based platform
DOS
CUI
Window
None
Single line comment is represented by (a)
JVM is a ----------
java Compiler
java Interpreter
both
None
The words which are preserved with the system are called --------
(a)
Byte code is the program in ------------- form.
(a)
Write the name of exit controlled loop.
(a)
Name of a Java Program
(a)
System.out.println(Math.cbrt(125)) will give output
(a)
System.out.println(Math.ceil(-12.5)) will give output
(a)
System.out.println(Math.floor(12.5)) will give output
(a)
System.out.println(Math.round(-12.5)) will give output
(a)
System.out.println(Character.toUpperCase('a')) will give output
(a)
for(i =10;i>=5;i-=2)
{
System.out.print("*");
}
will give output
(a)
for(i=1;i<=3;++i)
{
for(j=1;j<=3;++j)
{
System.out.print("*");
}
}
Print() will be executed how many times.
(a)
Procedure oriented programming gives importance to
instruction only
Data only
Instructions and data both
none of these
POP mainly uses
Top down approach
Bottom up approach
Top down and bottom of both
None of these
object oriented programming mainly
top down approach
Bottom up approach
Both of these
None of these
An object belonging to particular class is known as __________ of class
Interface
instance
Alias
Member
object that share same attributes and behavior are grouped together into an
Instance
interface
class
Alias
________________is a technique wrapping both data and function together to keep them safe from unauthorized access and misuse
Abstraction
inheritance
Polymorphism
Encapsulation
____________Is the feature by means of which one class acquire the property of another class
Abstraction
Inheritance
Polymorphism
Encapsulation
The term oop stands for
object oriented procedure
object oriented packet
object oriented programming
object orientation procedure
java applications are_________
platform independent
platform dependent
do not need any platform to run
cannot run on windows
JVM stands for
java virtual machine
java video monitor
java visual monitor
java virtual monitor
JRE stands for
java runtime editor
java runtime environment
java runtime expression
java runtime enabler
java uses _______ for execution
compiler interpreter
compiler
interpreter
none
The program that translates code written in high level language into machine code is called________
assembler
compiler
linker
none
A program that translates an assembly language program into machine code is called____________
assembler
compiler
interpreter
none
java is _______
robust
secure
object oriented
all of above
java can be used to write_________
stand alone application only
internet applets
both a and b
none
java applications can run on
Windows
unix
mac
All
an object has _____
attribute
behaviour
state
all
A class is _________
object factory
a specification of objects
blueprint to create objects
all
____________ represents an entity in the real world with its identity and behavior
class
objects
procedure
function
_____________is a template to create similar objects that share common characteristics and behavior
a function
an attribute
a procedure
a class
the value of an object's_______ represents the state of the object
methods
procedure
attribute
classes
The term objects and ____________are often interchangeable
instance
attribute
behaviour
state
ASCII stands for______
American standard code for information interchange
American simulated code for information interchange
American standard code for interchange of information
American standard code for interaction of information
ASCII is _____
6 bit set of codes
7 bit set of codes
8 bit set of codes
16 bit set of codes
Extended ASCII is
6 bit set of codes
7 bit set of codes
8 bit set of codes
16 bit set of codes
Which of the following is not a token?
keyword
operator
identifier
procedure
Which of the following is a keyword?
chracter
object
break
attribute
Which of the following is not a legal identifier?
_age
9thclass
$Amount
nullValue
Which of the following is an invalid integer?
1999
1999 99
1999999
19
Which of the following is not a character literal?
'\t'
"\t"
't'
all
Which of the following punctuator is a statement Terminator in Java?
;
,
.
?
Which of the following is not a primitive data type in Java?
boolean
float
short
class
Which of the following is the size of a long data type in Java?
32 bits
48 bits
64 bits
none
Which of the following is the size of a boolean data type in Java?
1 bit
2 byte
16 bits
boolean data type does not hold any space
And operator taking only single operand for its operation is called
unary operator
ternary operator
binary operator
which one of the following is not a binary operator?
AND
==
%
!
which one of the following is not a valid operator in java
<=
!=
!==
==
the statement i=i+1 is equivalent to
i++
++i
i+=1
all
for x=5 the statement sum = ++x + 8 evaluates to
sum= 13
sum = 15
sum = 14
sum = 16
the statement (1>0) &&(1<0)
0
1
false
true
the statement (1>0) || (1<0) evaluates to
0
1
true
false
the statement (1==1)?1:0 evaluates to
0
1
false
true
the expression 13/3 gives the output
4
3
0
1
the expression 13%3 gives the output
4
2
3
1
The statement System.out.println("six"+3+3); gives the output
six 33
33 six
six 6
6 six
the expression 4+8%2 gives the output
6
8
4
none
single line comments can be added using
//
/* */
\\
both a and b
which keyword do you use do you include a class in your program?
import
export
new
include
our default delimiter using scanner class is
comma
Whitespace
colon
there is no default delimiter
which package would you import to display the date and time
java.util
java.io.*
java.Date
java.lang.*
which package would you import for the Scanner class ?
java.util.*
java.io.*
java.awt.*
java.lang.*
errors occurring program when
the program does not run properly or does not execute at all
the program produce an incorrect result
syntax of programming language is not followed
all of the above
Which java package include math class
java.io
java.util
java.lang
java.sys
Give the output of Math.sqrt(x); when x=9.0
3
3.0
3.00
all
Give the output of Math.ceil(46.6)
46.6
47.0
46.5
all
give the output of Math.abs(x); when x=-9.99
-9.99
0.99
9.99
none
which of the following is a method to find the square root of a number
FindSqureRoot(x)
Math.Square(x)
Sqrt(x)
Math.sqrt(x)
Give the output of Math.pow(2,0)
0.0
1.0
2.0
-1.0
Math.random() returns a double value r such that
0.0<= r <1.0
0.0< r <=1.0
0.0<= r <=1.0
0.0<=r <1.0
Give the output of Math.floor(46.6)
46.5
-46.0
47.0
46.0
Collection of similar classes, interfaces and sub packages
variable
Interface
packages
class
Define Subpackage
class member of package
interface member of package
package within another package
None
API
applet programming interface
application programming interface
all time program interterface
None
Uses of Packages
easily maintained
access protection
avoid naming collision
None
package types
user defined
built-in package
both
none
what is the Syntax to define or create a package?
package <package_name>
package <package_name>;
import package <package_name>;
none
___________ is a collection of prewritten packages, classes, and interfaces with their respective methods, fields and constructors.
API package
class
interface
user defined package
what is syntax to import all the content of package?
import package_name.class_name;
import package_name.*;
import pak1.pak2.pak3;
None
what is syntax to import a particular class of package?
import class_name.*;
import package_name.*;
import pak1.pak2.pak3;
import package_name.class_name;
Access modifiers are
public
Default
private
protected
which member of a class can be accessible by the child of it of the same package?
public
private
defualt
protected
Which member of a class can be accessible by another class of the same package?
public
private
default
protected
which member of a class can be accessible by the child class of another package?
public
private
protected
default
which member of a class can be accessible by other member of the same class?
public
private
defualt
protected
Access Modifier controls___________.
whether other packages can use a particular field or invoke a particular method.
whether other interfaces can use a particular field or invoke a particular method.
whether other classes can use a particular field or invoke a particular method.
None
Name the package that contains the class Scanner
(a)
Which of the following is not a reserved word
public
private
end
none
JVM is a --------------
(a)
(a) convert source code to byte code.
Who developed Java
(a)
Which Math function is used to find absolute value of the argument?
(a)
Java program executed by the web browser is (a)
Java language use both
Compiler
Interprerter
Assembler
DTP
Math.round(2.1) will give (a)
Math.floor(-2.9) will give (a)
Math.ceil(-9.1) will give ----------
(a)
Which package automatically imported into our java program.?
(a)
(a) operator allocates memory dynamically to an object.
System.out.println(Character.isDigit(A)) will give (a) as output.
