I'm not understanding why this isn't working?? | Sololearn: Learn to code for FREE!
+ 2

I'm not understanding why this isn't working??

It is supposed to compare the input, and give output depending on the input! https://code.sololearn.com/cTTMVfkmCBRW/?ref=app

28th May 2020, 8:48 PM
Calvin Capstone
Calvin Capstone - avatar
6 odpowiedzi
+ 2
https://code.sololearn.com/cmq3yZZk8n8R/?ref=app Check this Calvin Capstone See if you can understand
28th May 2020, 9:00 PM
ABHISHEK
ABHISHEK - avatar
+ 4
A single equal assigns a value, double compares: myVar == 100 Since this is one of the most common and additionally one of the best hidden coding bugs, I recommend to use constants (final modifier) as far as possible.
28th May 2020, 8:53 PM
Sandra Meyer
Sandra Meyer - avatar
+ 3
Wrong assignment of scanner is in fact the first problem occurring 🙃
28th May 2020, 8:55 PM
Sandra Meyer
Sandra Meyer - avatar
+ 2
ABHISHEK THANKS A LOT MAN
29th May 2020, 1:04 PM
Calvin Capstone
Calvin Capstone - avatar
+ 1
Problem is here you haven't make scanner object
28th May 2020, 8:52 PM
ABHISHEK
ABHISHEK - avatar
+ 1
// Scanner int myVar = new Scanner(System.in); Scanner sc = new Scanner(System.in); // System.out.println(myVar.nextLine()); int myVar = sc.nextInt(); System.out.println(myVar); // if(myVar = 100){ if(myVar == 100){ // System.out.printIn("Good"); // typo In (IN) instead ln (LN) System.out.println("Good"); }
29th May 2020, 12:28 AM
zemiak