Home C C++ Java Python Perl PHP SQL JavaScript Linux Selenium QT Online Test

Home » Java » If & Else

Java Interview Questions on If & Else - 8


Question: 1

(A) Compilation Error
(B) Length is 5-10
(C) Length not in 5-10
(D) nothing is printed

Level: Practitioner Category of MCQ: if-else



Question: 2

(A) SunMoon
(B) Sun
(C) Moon
(D) Compilation Error

Level: Practitioner Category of MCQ: if-else



Question: 3

(A) Moon
(B) Sun
(C) SunMoon
(D) error: int can not be converted to boolean

Level: Practitioner Category of MCQ: if-else



Question: 4

(A) Sun
(B) Moon
(C) SunMoon
(D) Compilation Error

Level: Practitioner Category of MCQ: if-else



Question: 5

(A) Sun
(B) Nothing is printed
(C) Compilation Error
(D) Exception

Level: Practitioner Category of MCQ: if-else



Question: 6

(A) Compilation Error
(B) Sun
(C) Nothing is printed
(D) error: unreachable statement

Level: Practitioner Category of MCQ: if-else



Question: 7

(A) Compilation Error
(B) exception: unreachable code
(C) Sun
(D) SunMoon

Level: Beginner Category of MCQ: if-else



Question: 8

(A) Sun
(B) SunMoon
(C) Nothing is printed
(D) Compilation Error

Level: Practitioner Category of MCQ: if-else



Browse Java Categories

Datatype Variables Operators Decision Making Loops Methods Reference Variables Arrays Classes and Objects Abstract Class Singleton Class Modifiers Inheritance Overriding Polymorphism Abstraction Encapsulation Files and I/O TypeCasting Packages Exceptions Collections Framework Numbers Class Date & Time Regular Expressions Data Structures Interfaces Multithreading Other