Predict the output of following Java program | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

Predict the output of following Java program

class T {   int t = 20;   T() {     t = 40;   } } class Main {    public static void main(String args[]) {       T t1 = new T();       System.out.println(t1.t);    } }

7th Jan 2018, 2:40 PM
Mr.Learner
Mr.Learner - avatar
1 Réponse
+ 1
40
7th Jan 2018, 2:40 PM
Mr.Learner
Mr.Learner - avatar