+ 10
How can I do in Java that something repetes without to stop?👍🏼
????❓❔
11 Answers
+ 7
Yes i know thx
+ 6
while (true){
System.out.println("Thank you very much😀👍🏼");}
+ 5
Thanks but I mean ...for example: I learn Java
I learn Java
I learn Java
I learn Java
I learn Java
I learn Java
I learn Java
I learn Java
I learn Java
I learn Java
I learn Java
I learn Java
I learn Java
I learn Java
I learn Java
I learn Java
I learn Java
I learn Java
I learn Java
I learn Java
I learn Java
I learn Java
I learn Java
I learn Java
I learn Java
I learn Java
I learn Java
I learn Java
I learn Java
I learn Java with out stop
.....
+ 5
very simple with loop
a = 1
while a>0
increment "a"
+ 4
infinite loop you mean? Few examples:
while(true){}
for (;;){}
+ 4
for(;;);
+ 3
for(;;){
//Your code here
}
+ 2
so put text inside while or for, like
while(true) {
System.out.println("I learn Java");
}
+ 2
public class Program {
public static void main(String[] args)
{
int i=1;//constant value
while(i==1)//condition will never get false
{
System.out.println("any thing you wanna write");
}
}
}
+ 2
you could also make a variable containing the sring you wish to make forever the use the system provided above exept replace the text part with your variable like so
while(true){
var a;
a = “I repeat forever”;
System.out.printIn(a);
}
atleast I think this would work?
+ 2
a = 1
while a>0
increment "a"