- 1

Hi,can someone please help me what's wrong with this java code ? I keep getting an error.

I'm trying to learn from java : The complete reference and i tried this code.But it is giving me error. Public class Main { public static void main(String args[]) { int x, y; Y = 20; for(x = 0; x<10; x++) { system.out.println("This is x:" + x); system.out.println("This is y:" + y); y = y - 2; } } }

1st Sep 2020, 5:06 PM
Sushobhan Sengupta
3 odpowiedzi
+ 1
Public 'p' should be lowercase System 'S' should be uppercase
1st Sep 2020, 5:09 PM
Infinity
Infinity - avatar
+ 14
hello!!... actually u have to look into the syntax...caps and small b/w error was just these >u declared y* and initialised using Y* >System class 1st letter is capital >access specifier public it's small...u did it Public https://code.sololearn.com/cr1pAeDS8YIF/?ref=app
1st Sep 2020, 5:09 PM
chaithra Gowda
chaithra Gowda - avatar
+ 2
Hello, thank you for helping me out guys.
1st Sep 2020, 5:15 PM
Sushobhan Sengupta