Skip to content
Advertisement

Is there an example where the Java code repeatedly executes its own code? [closed]

Example:

int a = 10; 
System.out.println(a);

How can the value of the variable a be printed again after a restart of the application?

Advertisement

Answer

When you restart the application the variable a is printed out. You restart it 5 times, a will be printed out 5 times + the original first.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement