+ 1

How can I fix this code? How do I code 2 methods in one class? Just look at the code that I did...

How can I fix this code? How do I code 2 methods in one class? Just look at the code that I did... https://code.sololearn.com/cp4702HNczEx/?ref=app

30th Mar 2020, 4:44 PM
Yahel
Yahel - avatar
4 ответов
+ 2
your code has some braces problems. corrected version : import java.util.Scanner; public class Program { public static void main(String[] args) { hoho(); line(); } public static void hoho(){ Scanner lolo= new Scanner (System.in); for(int x= lolo.nextInt();x<100 + 1; x++) { System.out.println (x); } } public static void line(){ System.out.println("this row of numbers start at the number you chose and riches to a hundred."); } }
30th Mar 2020, 4:58 PM
John Robotane
John Robotane - avatar
+ 1
Your code is fine now having braces issues https://code.sololearn.com/ciEinq19Qsid/?ref=app
30th Mar 2020, 5:00 PM
Muhammad Bilal
Muhammad Bilal - avatar
+ 1
John Robotane thank you!!!!!!!
30th Mar 2020, 5:04 PM
Yahel
Yahel - avatar
30th Mar 2020, 5:05 PM
Yahel
Yahel - avatar