MCQ Single Best Answer Not Set

QWhat will be the output of the program ?
public class Test 
{
    public static void main(String [] args) 
    {
        signed int x = 10;
        for (int y=0; y<5; y++, x--)
            System.out.print(x + ", ");
    }
}

ID: #1998 Java Language Fundamental 1,345 views
Question Info
#1998Q ID
Not SetDifficulty
Java Language FundamentalTopic

Choose the Best Option

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

  • A 10, 9, 8, 7, 6,
  • B 9, 8, 7, 6, 5,
  • C Compilation fails.
  • D An exception is thrown at runtime.
Correct Answer: Option C

Explanation

The word "signed" is not a valid modifier keyword in the Java language. All number primitives in Java are signed. Hence the Compilation will fails.

Share This Question

Challenge a friend or share with your study group.