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 6

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

What is the return type of a method that does not returns any value?

int

float

void

double

SHOW ANSWER

What is the process of defining more than one method in a class differentiated by method signature?

Function overriding

Function overloading

Function doubling

SHOW ANSWER

Which of the following is a method having same name as that of it’s class?

finalize

delete

class

constructor

SHOW ANSWER

Which method can be defined only once in a program?

main method

finalize method

static method

private method

SHOW ANSWER

Which of these statement is incorrect?

All object of a class are allotted memory for the all the variables defined in the class

If a function is defined public it can be accessed by object of other class by inheritation

main() method must be made public

All object of a class are allotted memory for the methods defined in the class

SHOW ANSWER

Which of these will happen if recursive method does not have a base case?

An infinite loop occurs

System stops the program after some time

After 1000000 calls it will be automatically stopped

SHOW ANSWER

Which concept of Java is achieved by combining methods and attribute into a class?

Encapsulation

Inheritance

Polymorphism

Abstraction

SHOW ANSWER

What is it called where child object gets killed if parent object is killed?

Aggregation

Composition

Encapsulation

Association

SHOW ANSWER

What is it called where object has its own lifecycle and child object cannot belong to another parent object?

Aggregation

Composition

Encapsulation

Association

SHOW ANSWER

When does method overloading is determined?

At run time

At compile time

At coding time

At execution time

SHOW ANSWER

What requires less resources?

Thread

Process

Thread and Process

SHOW ANSWER

What does not prevent JVM from terminating?

Process

Daemon Thread

User Thread

JVM Thread

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