Time Left - 08:00 mins

RRB JE (IT) : JAVA Programming Quiz 5

Attempt now to get your rank among 484 students!

Question 1

Which of the following is a valid declaration of an object of class area?

Question 2

In java, the class which is the superclass of every classes defined as “Class”, is present in package________.

Question 3

String data type is______.

Question 4

Which modifier prevent any methods or attributes to be invisible from outside objects?

Question 5

Consider the following snippet of the code

Public class Main{

Public static void main(String args[])

{

Int var1=5;

Int var2=8;

System.out.println(!(var1>var2));

}

The output of the above code will be

Question 6

Which of the following statement is correct

Question 7

Which modifier can be used to restrict any method or attribute to be visible to all the classes within the same package and to only its child classes inn other package.

Question 8

Consider the following code

Public class Main{

Public void func1(int I, float f){

System.out.println(“func1(int I, float f)”);

}

Public void func1(float f, int i){

System.out.println(“func1(float f, int i)”);

}

Public static void main(String args[])

{

Main m=new Main();

m.func1(14,15);

}

The output of the above code will be

Question 9

Which of the following keyword is used to implement synchronization in java programs?

Question 10

Which of the following is correct constructor to be used for thread.

1) Thread(int priority)

2) Thread(Runnable a, String str)

3) Thread(Runnable a, int priority)

4) Thread(Runnable a, int priority, String str)

  • 484 attempts
  • 1 upvote
  • 3 comments
Aug 16GATE & PSU CS