Call
whatsapp
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
Cisco Training in Trivandrum, Trinity Technologies

No.1 Training Institute in Kerala

JAVA QUESTIONS : PART 31

Which statement is true about java?

Platform independent programming language

Platform dependent programming language

Code dependent programming language

Sequence dependent programming language

SHOW ANSWER

What is the extension of java code files?

.class

.java

 .txt

.js

SHOW ANSWER

What is the extension of compiled java classes?

 .class

.java

.txt

.js

SHOW ANSWER

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

SHOW ANSWER

What 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 ANSWER

Which of the below is invalid identifier with the main method?

public

static

private

final

SHOW ANSWER

Which of these keywords is used to make a class?

class

struct

int

none of the mentioned

SHOW ANSWER

Which 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 ANSWER

Which of these operators is used to allocate memory for an object?

malloc

alloc

new

give

SHOW ANSWER

What 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 ANSWER

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

SHOW ANSWER

What 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 ANSWER

What 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
BACK | NEXT
TRINITY SOFTWARE SOLUTIONS,IInd floor, Radheyam Towers, Gandhari Amman Kovil Road, Pulimood, Trivandrum - 1
0471-2334855 | 2335855 | 9447387064 | 9847003556 info@trinitytechnology.in