Q. Predict the output?

Code:
package main;
class T {
  int t = 20;
}
class Main {
   public static void main(String args[]) {
      T t1 = new T();
      System.out.println(t1.t);
   }
  • (A) 20
  • (B) 0
  • (C) Compiler Error
  • (D) None of these
πŸ’¬ Discuss
βœ… Correct Answer: (A) 20

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
588
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
90%
Success Rate