+ 1

Please explan this program(methods)

public class Strange { public static void main(String[]args) { first(); third(); second(); third(); } public static void first() { System.out.println("1."); } public static void second() { System.out.println("2."); first(); } public static void third(){ System.out.println("3."); first(); second(); } }

31st Jul 2019, 7:48 AM
Rajesh Rathod
Rajesh Rathod - avatar
1 Réponse
+ 4
The main method calls three different other methods, one of them twice. These other methods output strings containing numbers. Two of these methods also invoke other methods already referred to.
31st Jul 2019, 9:09 AM
Sonic
Sonic - avatar