Which statement is true about java?
Platform independent programming language
Platform dependent programming language
Code dependent programming language
Sequence dependent programming language
SHOW ANSWERWhat is the extension of java code files?
.class
.java
.txt
.js
SHOW ANSWERWhat is the extension of compiled java classes?
.class
.java
.txt
.js
SHOW ANSWERWhat 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
SHOW ANSWERWhat is the stored in the object obj in following lines of code?
box obj;
Memory address of allocated memory of object
NULL
Any arbitrary pointer
Garbage
SHOW ANSWERWhich of the below is invalid identifier with the main method?
public
static
private
final
SHOW ANSWERWhich of these keywords is used to make a class?
class
struct
int
none of the mentioned
SHOW ANSWERWhich of the following is a valid declaration of an object of class Box?
Box obj = new Box();
Box obj = new Box;
obj = new Box();
new Box obj;
SHOW ANSWERWhich of these operators is used to allocate memory for an object?
malloc
alloc
new
give
SHOW ANSWERWhat is the output of this program?
class main_class
{
public static void main(String args[])
{
int x = 9;
if (x == 9)
{
int x = 8;
System.out.println(x);
}
}
}
9
8
Compilation error
Runtime error
SHOW ANSWERWhich 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
SHOW ANSWERWhat is the output of this program?
class box
{
int width;
int height;
int length;
}
class MainCls{
public static void main(String args[]) {
box obj = new box();
obj.width = 10;
obj.height = 2;
obj.length = 10;
int y = obj.width * obj.height * obj.length;
System.out.print(y);
}
}
12
200
400
100
SHOW ANSWERWhat is the output of this program?
class box
{
int width;
int height;
int length;
}
class mainclass
{
public static void main(String args[])
{
box obj = new box();
System.out.println(obj);
}
}
0
1
Runtime error
classname@hashcode in hexadecimal form
SHOW ANSWER