Java Programming OOPs
Questions 151 to 160
Select the correct
statement from among the following:
(a)
Java language was developed by Micro Soft
(b)
Java language was developed in 1990
(c)
Java language was written by James Bond
(d)
The initial name given for Java is Oak
(e)
The project which developed Java is
called Grand project.
|
||||||
Consider the following program written in Java:
class
Three{
public
static void main(String three[])
{
System.out.println("Hello");
}
}
Select
from among the following, a suitable name which can be used as the source
file name.
(a)
Hello.java (b) three.java (c) Three.java (d) Three.class (e) three.class.
|
||||||
Java Bytecode is
(a)
the Java virtual machine version of
machine code.
(b)
known as the Java interpreter or Java
run time.
(c)
a set of programming statements
entered into a text editor by a programmer.
(d)
similar to machine code which is specific to any processor.
(e)
not an additional layer in-between the
source code and the machine code.
|
||||||
Breaking down a large complex procedure into a number of
smaller procedures is referred to as
(a)
data structures (b)
top down decomposition.
(c)
structured programming. (d)
lists.
(e)
amateur programming.
|
||||||
Consider the following statements on global data:
Global
data
(i)
can be accessed by a number of
procedures.
(ii)
is defined within an outer procedure
and may then be shared by the inner procedure.
(iii)
encourages the need to pass the data
from one procedure to another.
(iv)
causes inconsistencies when shared by
procedures.
Choose the incorrect
statement from among the above.
(a)
Only (i) is incorrect (b)
Both (i) and (ii) are incorrect
(c)
Only (ii) is incorrect (d)
Both (iii) and (iv) are incorrect
(e)
Only (iii) is incorrect.
|
||||||
Consider the following variable declarations:
int
i;
float
j;
boolean
k;
Which of the following is correct initialization?
(a) i = 1; j = 1.0; k = true; (b) i = 1; j = 1.0f; k
= true;
(c) i = 1; j = 1.0f; k = “true”; (d) i = 1; j = 1.0; k =
“true”;
(e) i = 1; j = 1.0f; k = True;
|
||||||
Use the following declarations and initializations to
evaluate the Java expressions:
(Please
note that each expression has been tested separately.)
int i=3, j=7, k=11;
7) j + k % i
(a) 9 (b) 0 (c)
7 (d) 12 (e) 10.
|
||||||
Use the following declarations and initializations to
evaluate the Java expressions:
(Please
note that each expression has been tested separately.)
int i=3, j=7, k=11;
++k –i +i + i++
(a) 16 (b) 17 (c)
14 (d) 13 (e) 15.
|
||||||
Use the following declarations and initializations to
evaluate the Java expressions:
(Please
note that each expression has been tested separately.)
int i=3, j=7, k=11;
j * k++ /2
(a) 38.5 (b) 42 (c)
38 (d) 42.0 (e)
42.5.
|
||||||
Consider the following Java program:
public
class MyClass {
private
int myVlaue = 5;
public
void printMyVlaue() {
System.out.println(myVlaue);
}
public
void setMyVlaue(int myVlaue) {
System.out.println(myVlaue);
this.myVlaue
= myVlaue;
}
public
static void main(String[] args) {
MyClass
myClass1 = new MyClass();
myClass1.setMyVlaue(10);
myClass1.printMyVlaue();
}
}
Which of the following will the output be?
|
Answers
Answer : (d)
Reason : Remaining
all are irrelevant as java was developed by sun,1991etc
|
|
Answer : (c)
Reason : Source files
are to stored using .java extension and Class Name would be preferably the
source file name with case sensitivity.
|
|
Answer : (a)
Reason : The virtual
machine version of machine code is java byte code. It is not java interpreter
or set of.
|
|
Answer : (b)
Reason : According to
OOPS it is termed as top down compostion. Remaining all relate to different
concepts
|
|
Answer : (e)
Reason : All are the
properties of global data whereas the third statement is incorrect.
|
|
Answer : (b)
Reason : is the
appropriate form of initialization. remaining all are incorrect.
|
|
Answer : (a)
Reason : k%i is 2 and
j+2=9.
|
|
Answer : (e)
Reason : Based on the
hierarchy of operations (e) is the correct answer.
|
|
Answer : (c)
Reason : Based on the
hierarchy of operations 38 is the correct answer
|
|
Answer : (b)
Reason : Based on the
methods call the out put is 10 10.
|
thank you.
ReplyDeletejava tutorial
java tutorial