What am I doing wrong?

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

<do not remove the three backticks above>

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

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)

1 Like

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

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?

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

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