Dev_Socius
New Coder
Alright so I had this dumb idea to write some code that will insult you every time you request it to, I'm doing this on a site called Jdoodle, I'm using the Javascript program and this is what I have so far.
And this is the error it gave me.
Java:
import java.util.Scanner;
public class TheRudeComputer{
public static void main(String args[]) {
Scanner scnr = new Scanner (System.in);
String Yes;
String No;
System.out.println(" So, you ever wanna be yelled at by a computer? You do? Dude what the hell is wrong with you...");
System.out.println(" Well I guess I can help you with your joke of a problem, so do you want to be yelled at? Yes or No?");
No = scnr.nextLine();
System.out.println(" Well shit ok guess you don't want me to cuss you out. ");
Yes = scnr.nextline();
System.out.println(" Alrighty then! Lets get to it!");
And this is the error it gave me.
Bash:
TheRudeComputer.java:17: error: cannot find symbol
Yes = scnr.nextline();
^
symbol: method nextline()
location: variable scnr of type Scanner
1 error
}
}
Last edited by a moderator: