Single Choice Moderate

QCondition inside if must evaluate to:

ID: #25853 MCQ Quiz - Class 8 - Programming 10 views
Question Info
#25853Q ID
ModerateDifficulty
MCQ Quiz - Class 8 - ProgrammingTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A boolean ✔ ✖
  • B int ✔ ✖
  • C String ✔ ✖
  • D double ✔ ✖
Correct Answer

Explanation

Correct Answer Explanation:

In Java, the if condition MUST be a boolean expression (true or false). This is stricter than languages like C where 0/nonzero worked.

Why the other options are incorrect:

  • Option B: int alone isn't a boolean condition in Java.
  • Option C: String isn't a valid if condition in Java.
  • Option D: double isn't a valid if condition in Java.
Today: 0 answered · 0 correct
Save progress
Free account

Want to remember what you got wrong?

Create a free account in seconds to track your score, revisit mistakes and continue ICSE Class 8 Computer Studies (Latest CISCE Syllabus) where you left off.

  • Save your progress & streak
  • Topic-wise quizzes & scores
  • Bookmark tricky questions
  • Printable MCQ sets
Practice smarterFree account · save progress
Sign up free

Share This Question

Challenge a friend or share with your study group.