What am I doing wrong?


#1

I'm at 'Maths Magic' in the Java course and I'm having trouble here.

(Error message)

Magic.java:10: error: cannot find symbol
System.out.printIn(stepSix);
^
symbol: method printIn(int)
location: variable out of type PrintStream
1 error


public class Magic {
	public static void main(String[] args) {
		int myNumber = 5;
		int stepOne = myNumber * 5;
		int stepTwo = stepOne + 5;
		int stepThree = stepTwo / 5;
    int stepFour = stepThree + 17;
    int stepFive = stepFour - 5;
    int stepSix = stepFive / 6;
    System.out.printIn(stepSix);
	}
}
//This does maths for you

I tried doing the actual numbers themselves instead of the variable names but that still didn't work.


#2

On line 10, you have:

System.out.printIn(stepSix);

Instead of:

System.out.println(stepSix);

Do you see it? You have "IN" instead of "LN" (of course it must be lowercase)


#3

This goes to the top of the list of times I've been proven wrong.


#4

So, just for clarification, it's "PrintLn" (in caps to point out certain letters) and not "PrintIn"? To be more precise it's print - LN not print - In?


#5

Its println
(Which is print and then lowercase LN)
Stands for print line


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.