adplus-dvertising
frame-decoration

Question

What will be the output of the program?
class Main {  
   public static void main(String args[]) {    
         int t; 
         System.out.println(t);
    } 
}

a.

0

b.

garbage value

c.

compiler error

d.

runtime error

Posted under Java Programming

Answer: (c).compiler error

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be the output of the program?

Similar Questions

Discover Related MCQs

Q. Which of the following are legal lines of Java code?

1. int w = (int)888.8;
2. byte x = (byte)100L;
3. long y = (byte)100;
4. byte z = (byte)100L;

Q. Which of the following are legal lines of Java code?

1. int w = (int)888.8;
2. byte x = (byte)100L;
3. long y = (byte)100;
4. byte z = (byte)100L;

Q. Which of these coding types is used for data type characters in Java?

Q. Java array is a collection of ________.

Q. Array data access using _____.

Q. At time of array initialization which is necessary to specify?

Q. Java Array can allocate __________.

Q. Which of the following is an incorrect array declaration?

Q. Index in array start with ______.

Q. Which of the following is used to declare,construct, and initlaize an array?

Q. We can calculate the length of an array using ________.

Q. Which of the following is advantage of java array?

Q. In java, array elements are stored in ________ memory locations.

Q. What does a Data Type in Java refers to?

Q. Choose the wrong statement about Java programming?

Q. Which data type among the following is an implementation of Objects or OOPs?

Q. What is a Primitive Data Type in Java?

Q. Which among the following is not a Data Type in Java?

Q. Which among the following is not a valid Data Type in Java?

Q. Which is the data type used mostly to handle streams and buffers in Java language?