java 2021

1. In object oriented language,what is true about OOPs:

 
 
 
 

2. Which one of the following is not an object oriented language :

 
 
 
 

3. What is purpose of reusability in OOPS :

 
 
 
 

4. What was the name of first version of java ?

 
 
 
 

5. Which tool is used to compile the java Program?

 
 
 
 

6. Java Removes not referenced objects from memory automatically by using___

 
 
 
 

7. What is extension of the byte code files in java ?

 
 
 
 

8. Which is not related with java from the followings:

 
 
 
 

9. What is the extension of the source file of java programmings?

 
 
 
 

10. When following will be compiled , then at which line error will be noticed :

public class castprint{

public static void main(String a[])

{

char c;

int k;

c=’A’;

k=c;

c=k+10;

++c;

}

}

 

 
 
 
 

11. What is the output of the following program?

class ok
{
public static void main(String B[])
{
int a,b,c,d=0;
c=d++;
b=++c;
a=b++;
System.out.println(a);
}
}

 
 
 
 

12. What will print on screen when following program will compiled?

class myprint
{
public static void main(String K[])
{
int m=0;
boolean b2=true;
boolean b3=false;
boolean b4=(b2&&((m++)==0));
b4=(b3&&((m++)==0));
System.out.println(m);
}
}

 
 
 
 

13. When program will be compiled then what will the part of output, select any one from the followings:

class count
{
public static void main(String E[])
{
for (int m=0;m<3;m++)
{
for (int n=3;n>0;n–)
{
if(m==n)
continue;
System.out.println(m+””+n);
}
}
}
}

 
 
 
 

14. When program will be compiled then what will be the part of output , select any one from the followings:

class less
{
public static void main(String P[])
{
for (int m=0;m<3;m++)
{
for (int n=3;n>0;n–)
{
if(m==n)
break;
System.out.println(m+””+n);
}
}
}
}

 
 
 
 

15. Which statement is correct for length of an array :

 
 
 
 

16. Which of these statement is not correct:

 
 
 
 

17. Select correct way to declared and define method in java

 
 
 
 

18. What is the output of the program after compile and Run:

class Mango

{

public static void main()

{

System.out.println(“Mango”);

}

}

 
 
 
 

19. What will happen , when this program will Run using command java Table

class table
{
public static void main(String []A)
{
if(A.length>0)
System.out.println(A.length);
}
}

 
 
 
 

20. What is the result of compile & run of the following program:

class USA

{

USA(int K)

{

System.out.println(“USA”);

}

}

public class world extends  USA

{

public static void main(String A[])

{

world w=new world();

}

void world()

{

System.out.println(“world”);

}

}

 

 
 
 
 

21. Which of the following statement are true :

 
 
 
 

22. What is the output of the following program:

class test
{
int i;
}
class main
{
public static void main(String P[])
{
test t=new test();
System.out.println(t.i);
}}

 

 
 
 
 

23. Select correct option for this program

class USA

{

void USA()

{

System.out.println(“USA”);

}

USA(int U)

{

System.out.println(“U”+1);

}

}

 

 
 
 
 

24. What happen when program will compile and run:

abstract class man
{
abstract void show()
{
}
}
public class ok extends man
{
OK()
{
System.out.println(“ok”);
}
public static void main(String S[])
{
ok a = new ok();
}
}

 
 
 
 

25. What will Happen when you attempt to compile and run the following class ?

class test

{

test(int a)

{

System.out.println(“OK”);

}

}

class exam extends test

{

exam(int a)

{

System.out.println(a);

}

public static void main(String K[])

{

exam e=new exam(10);

}

}

 

 
 
 
 

26. Which keyword is used prevent inheritance?

 
 
 
 

27. What will happen in the following program, when it will be compiled :

abstract final class Demo

{

//Will check now

}

 

 
 
 
 

28. What is the correct sequence of the following code lines:

  1. class X{}
  2. import java.util.*;
  3. package a;
 
 
 
 

29. Which keyword is used for accessing the features of a package :

 
 
 
 

30. What are the two type  of exception available in java :

 

 
 
 
 

31. The Parent class of all exceptions in java is :

 
 
 
 

32. The  Two Subclasses of Throwable are :

 
 
 
 

33. Which type of exception does a sleep() method throw?

 
 
 
 

34. Which state is entered once a thread is created ?

 
 
 
 

35. Which  method is used to know the current state of the Thread :

 
 
 
 

36. Which package contains Thread Classes and interfaces?

 
 
 
 

37. Which of the following interface is used to create a Thread?

 
 
 
 

38. Which class is used to create a Thread?

 
 
 
 

39. What is the default Priority assigned to all java Threads?

 
 
 
 

40. Which abstract class is the super class of all classes used for writing bytes?

 
 
 
 

41. Name the Exception Thrown by the Read method defined in the Input stream class :

 
 
 
 

42. What is the Exception Raised of the following codes :

String str =”123ABC”;

int a=Integer.parseInt(str);

 
 
 
 

43. What is not true about java :

 
 
 
 

44. Which collection does not contain duplicates?

 
 
 
 

45. Which of these package contain all the collection classes?

 
 
 
 

46. Which of these is not part of java’s collection

 
 
 
 

47. When does Exception in java arise in code:

 
 
 
 

48. Which of these keyword is not a part of Exception Handling:

 
 
 
 

49. Which Exception is Thrown When divide by Zero statement execute as

int a 10/0;

 

 
 
 
 

50. “A object can not know that how method is processing inside “. This statement comes under the categories of _

 
 
 
 

51. What is byte code in java ?

 
 
 
 

52. Which of the following are not java keywords ?

 
 
 
 

53. Which of these highest precedence?

 
 
 
 

54. What is the type of the value ‘1’?

 
 
 
 

55. Which variable is created when object is created using new keyword ?

 
 
 
 

56. Which one is a template for creating different objects?

 
 
 
 

57. Which one is true about constructor ?

 
 
 
 

58. Which of these operator is used to allocate memory to array variable in Java?

 
 
 
 

59. Which of these is not bitwise operator :

 
 
 
 

60. Which of these is returned by greater than,less than and equal to operators?

 
 
 
 

61. Which of the following are not the method of the Thread class ?

 
 
 
 

62. What is the full form of JVM?

 
 
 
 

63. In Java code the line begins with /*and ends with */is known as ?

 
 
 
 

64. Select any one , which is not java modifier :

 
 
 
 

65. Which of the following is not a java features?

 
 
 
 

66. The ‘\UOOA5’ Article Reffered to as a :

 
 
 
 

67. What is the value of R after evaluate the following java expression:

int x=3,y=5,z=10;

int R=++ z + y-y + z + x++;

 
 
 
 

68. What will be the output of the following program?

public class test

{

public static void main(String A[])

{

int count=1;

while(count<=15)

{

System.out.println(count%3==1? “xx’:”++”);

}

}

}

 
 
 
 

69. Which of the following is not valid for loop declaration?

 
 
 
 
 

70. Which of the following is true about the anonymous inner class?

 
 
 
 

71. Which package contains the Random class?

 
 
 
 

72. An Interface with no fields or methods is know as a:

 
 
 
 

73. What do you mean by chained exceptions in java?

 
 
 
 

74. When we create a string using new operator then in which memory a string is stored?

 
 
 
 

75. Which of the following is a maker interface ?

 
 
 
 

76. Which of the following is a Reserved keyword in java :

 
 
 
 

77. Which keyword is used for accessing the features of a package?

 
 
 
 

78. JAR stands for__

 
 
 
 

79. Java is a __ language .

 
 
 
 

80. Size of int in java ___ is .

 
 
 
 

81. Every statement in java language should end with a ___

 
 
 
 

82. A function in C language is similar to what in java language ?

 
 
 
 

83. A function in C language is similar to what in java language ?

 
 
 
 

84. All methods and variables in java language are kept inside a___

 
 
 
 

85. What is the need to mention static before main method ?

 
 
 
 

86. Which method is mandatory for java standalone application

 
 
 
 

87.

What is the use of Access modifier “pubic” in Java language?
 
 
 
 

88. String args[] in main method are used for _

 
 
 
 

89. What is the default return type of a method in java language?

 
 
 
 

90. Name of a class, variable, object, method or an interface is calles__ in java language .

 
 
 
 

91. What are the valid white space available in java language ?

 
 
 
 

92. Which one is the non – primitive data type?

 
 
 
 

93. What is the full form of AWT ?

 
 
 
 

94. ++X is equivalent to:

 
 
 
 

95. +C

onsider the statement

int a =19;

int b=91;

int c;

c=(a>b)?a:b;

System.out.println/ (c);

What is output?

 
 
 
 

96. Which is the top most class in java class hierarchy?

 
 
 
 

97. When a Thread starts , Which method is called automatically to Run the Thread ?

 
 
 
 

98. Which of the following classes are wrapper classes?

 
 
 
 

99. Which code java language supports

 
 
 
 

100. What is the output of the following:

boolean b1;

System.out.println(b1);

 
 
 
 

Question 1 of 100

Leave a Reply

Your email address will not be published. Required fields are marked *