Fundamentals of Java Class 11 MCQ

Teachers and Examiners (CBSESkillEduction) collaborated to create the Fundamentals of Java Class 11 MCQ. All the important Information are taken from the NCERT Textbook Information Technology (802) class 11.

Fundamentals of Java Class 11 MCQ

1. NetBeans is an IDE using which we can develop ___________ in Java.
a. GUI application 
b. CUI application
c. BW application
d. None of the above

Show Answer ⟶
a. GUI application

2. NetBeans provides various components used to create a GUI front-end interface like ___________.
a. jTextArea
b. jLabel
c. jButton
d. All of the above 

Show Answer ⟶
d. All of the above

3. GUI components’ __________ is controlled by their properties and methods.
a. Appearance
b. Behavior
c. Both a) and b) 
d. None of the above

Show Answer ⟶
c. Both a) and b)

4. We should use meaningful names for controls on the _________ in the code. It makes programming convenient.
a. Form
b. Variables
c. Both a) and b) 
d. None of the above

Show Answer ⟶
c. Both a) and b)

5. Some useful Data Types supported in Java are ___________.
a. Int & Boolean
b. Double
c. Char
d. All of the above 

Show Answer ⟶
d. All of the above

6. String is an _________ type supported in Java.
a. Object 
b. Constraint
c. Class
d. None of the above

Show Answer ⟶
a. Object

7. A variable must be declared _____________.
a. After it can be used
b. Between it can be used
c. Before it can be used 
d. None of the above

Show Answer ⟶
c. Before it can be used

8. What are the different operators used in Java _________.
a. Logical Operator
b. Conditional Operator
c. Comparison Operator
d. All of the above 

Show Answer ⟶
d. All of the above

9. The __________ selects among a set of statements depending on the value of a controlling expression.
a. If Statement 
b. For Statement
c. While Statement
d. None of the above

Show Answer ⟶
a. If Statement

10. If else statement is also known as ________.
a. Control statement 
b. Structure statement
c. Program statements
d. All of the above

Show Answer ⟶
a. Control statement

11. An IF statement in Java is also a _______ statement.
a. Number
b. conditional 
c. String
d. None of the above

Show Answer ⟶
b. conditional

12. In Java, an ELSE statement needs to come after a _________ statement.
a. IF
b. ELSE IF
c. IF or ELSE IF 
d. None of the above

Show Answer ⟶
c. IF or ELSE IF

13. It is required to define an IF statement code between two braces.
a. False 
b. True
c. Some time True and Some time False
d. None of the above

Show Answer ⟶
a. False

14. An ELSE statement’s code may be enclosed in braces.
a. FALSE
b. TRUE 
c. Some time True and Some time False
d. None of the above

Show Answer ⟶
b. TRUE

15. Without an IF statement, an ELSE or ELSE-IF statement in Java cannot occur.
a. FALSE
b. TRUE 
c. Some time True and Some time False
d. None of the above

Show Answer ⟶
b. TRUE

16. if the condition is false in if condition, which of the following will be true.
a. IF Statement will be executed
b. ELSE Statement is executed. 
c. IF and ELSE both will not execute.
d. IF and ELSE both will execute.

Show Answer ⟶
b. ELSE Statement is executed.

17. How many lines of code can be written inside an IF, ELSE, or IF-ELSE block in Java?
a. 25
b. 72
c. 105
d. None of the above 

Show Answer ⟶
d. None of the above

18. In which of the following situations is an IF-ELSE statement preferable to a SWITCH statement?
a. Checking multiple condition
b. Checking for Less-than condition
c. Checking for Ranges
d. All of the above 

Show Answer ⟶
d. All of the above

19. How many ELSE-IF statements can be present between the beginning IF and the closing ELSE statements?
a. 44
b. 55
c. 320
d. None of the above 

Show Answer ⟶
d. None of the above

20. Select the proper Java IF statement syntax from the list below.
a. if(condition) //statement
b. if(condition){ //statement}
c. if(condition){ //statement1 //statement2}
d. All of the above 

Show Answer ⟶
d. All of the above

21. What does the Java programme with IF-ELSE statements produce?
if(TRUE)
System.out.println(“True”);
else
System.out.println(“False”);
a. True
b. False
c. Compiler error 
d. None

Show Answer ⟶
c. Compiler error

22. What is the output of the Java program?
int a=10;
if(a==9)
System.out.println(” My “);
System.out.println(“School”);
else
System.out.println(“My Class”);
a. My School
b. My Class
c. Compiler error 
d. None of the above

Show Answer ⟶
c. Compiler error

23. What is the output of the Java program?
String name1=”My School”, name2=”My Class”;
if(name1 == “My School”)
{
System.out.print(“My School “);
System.out.println(“My Class”);
}
if(name2 == “No Class”)
{
System.out.println(“My Class”);
}
a. My School My Class 
b. My School My Class My Class
c. Compiler error
d. None of the above

Show Answer ⟶
a. My School My Class

24. What is the output of the Java program?
String name=”Anurag”;
if(name == “Anand”)
{
System.out.print(“Anurag”);
}
System.out.println(“Computer Science”);
a. Anurag Computer Science
b. Anurag
c. Computer Science 
d. Compiler error

Show Answer ⟶
c. Computer Science

25. What is the output of the Java program with ELSE-IF statements?
int marks=90;
if(marks >= 80)
System.out.println(“Distinction”);
else if(marks >=33)
System.out.println(“Pass”);
else
System.out.println(“Fail”);
a. Distinction
b. Pass 
c. Fail
d. Compiler error

Show Answer ⟶
b. Pass

26. What is the output of Java program below?
float temp = 97.3;
if(temp > 97.3)
{
System.out.println(“High Temperature”);
}
else
{
System.out.println(“Temperature”);
}
a. High Temperature 
b. Temperature
c. Compiler error
d. None of the above

Show Answer ⟶
a. High Temperature

27. What is the output of the Java program?
int marks = 91;
if(marks > 32)
{
if(age <= 100)
{
System.out.println(“Pass”);
}
}
else
{
System.out.println(“Fail”);
}
a. Pass 
b. Fail
c. Compiler error
d. None of the above

Show Answer ⟶
a. Pass

28. What is the output of the Java program?
int marks=55;
if(marks > 55);
System.out.print(“Pass “);
System.out.println(“Fail”);
a. Fail
b. Pass
c. Pass Fail 
d. Compiler error

Show Answer ⟶
c. Pass Fail

29. What is the result of the IF statement in a Java programme?
if(true)
{
break;
System.out.println(“School”);
}
a. No Output
b. School
c. Compiler error 
d. None of the above

Show Answer ⟶
c. Compiler error

30. Java is a ______ programming language.
a. Procedure Oriented
b. Object-Oriented 
c. Practical
d. All of the above

Show Answer ⟶
b. Object-Oriented

31. The code in the Java programming language is put inside ___________.
a. Blocks
b. Methods
c. Classes, Interfaces
d. All the above 

Show Answer ⟶
d. All of the above

32. What file extension is associated with the Java class source code?
a. .jpp
b. .jsp
c. .java 
d. None of the above

Show Answer ⟶
c. .java

33. What file extension is associated with compiled Java class files?
a. .jpp
b. .java
c. .class 
d. .clear

Show Answer ⟶
c. .class

34. In Java, the keyword used to declare a class is _________.
a. Function
b. Method
c. class 
d. Java

Show Answer ⟶
c. class

35. A Java class can contain___________.
a. Variables
b. Methods, Constructors
c. Inner Classes (A class inside another class)
d. All of the above 

Show Answer ⟶
d. All of the above

36. In Java, the word ________ is used to create a new object.
a. java
b. new 
c. class
d. function

Show Answer ⟶
b. new

37. In Java, an object is created at _________ time.
a. Assembling time
b. Run time 
c. Compile-time
d. None of the above

Show Answer ⟶
b. Run time

38. Select the appropriate Java class declaration syntax from the list below.
a. 
class CLASSNAME
{

}
b.
CLASSNAME class
{

}
c.
class CLASSNAME;
{

}
d.
Class CLASSNAME
{

}

Show Answer ⟶
a. class CLASSNAME { }

39. Pick the appropriate method for producing an object of the class listed below.
class Table
{
Table(){System.out.println(“Table Created”);}
}
a. Table t = new Table;
b. Table t = new Table();
c. Table() t = new Table();
d. None of the above

Show Answer ⟶
b. Table t = new Table();

40. A control statement in Java is called a _________ SWITCH case statement.
a. Iteration
b. Loop
c. Selection 
d. Jump

Show Answer ⟶
c. Selection

41. Which is the Java language equivalent of SWITCH?
a. break, continue
b. for, while
c. if, else 
d. goto, exit

Show Answer ⟶
c. if, else

42. What keywords are needed in Java to implement a SWITCH case?
a. switch, case
b. default
c. break
d. All of the above 

Show Answer ⟶
d. All of the above

43. Select the proper SWITCH statement syntax for Java from the list below.
a.
switch(input)
{
case constant1: //statements; break;
case constant2: //statements; break;
default: //statements;
};
b. 
switch(input)
{
case constant1: //statements; break;
case constant2: //statements; break;
default: //statements;
}
c.
switch(input)
{
case constant1: //statements; break;
case constant2: //statements; break;
default case: //statements;
};
d.
switch(input)
{
case constant1: //statements; break;
case constant2: //statements; break;
default case: //statements;
}

Show Answer ⟶
b. switch(input) { case constant1: //statements; break; case constant2: //statements; break; default: //statements; }

44. What is the result of the following Java application with SWITCH?
int a=10;
switch(a)
{
case 10: System.out.println(“Welcome”);
}
a. No output
b. Welcome 
c. Compiler error as there is no BREAK.
d. None

Show Answer ⟶
b. Welcome

45. What does the Java programme below produce?
String animal = “Horse”;
switch(animal)
{
break: System.out.println(“DOMESTIC”);
}
a. No output
b. Horse
c. DOMESTIC
d. Compiler error 

Show Answer ⟶
d. Compiler error

Employability Skills Class 11 Notes

Employability Skills Class 11 MCQ

Employability Skills Class 11 Questions and Answers

Information Technology Class 11 Notes

Information Technology Class 11 MCQ

Information Technology Class 11 Questions and Answers

Leave a Comment

error: Content is protected !!