public class Coon { String name = "Spiffo"; int mass = 8; String profession = "survivor"; public static void main(String[] args) { Coon sipffoObject = new Coon(); System.out.println(spiffoObject.runaway(20)); } 

Explain, please, intellij underlines the last line, swearing at spiffoObject, what is the reason?

  • Write the text of the error in question - Sergey Glazirin
  • one
    so you missed the last closing brace } . - And
  • No, actually by, I clarified that the error was somewhere in spiffoObject.runaway - I can not understand why, - I just started to learn the language, this is a question for the basics of logic - Quest
  • one
    Maybe because you have no runaway method? - iksuy
  • Have you thought sipffoObject and spiffoObject ? - AlTheOne

3 answers 3

Most likely, a syntax error, since you do not have enough closing brace "}".

[UPDATE]: The second syntax error, you write Coon sipffoObject = new Coon(); , and refer to spiffoObject.runaway...

Here is the adjustment:

 public class Coon { String name = "Spiffo"; int mass = 8; String profession = "survivor"; public static void main(String[] args) { Coon spiffoObject = new Coon(); System.out.println(spiffoObject.runaway(20)); } } 
  • Cool to take answers from my commentary. - And
  • @And this is allowed - Pavel Mayorov

sipffoObject and spiffoObject, a simple typo, thanks to everyone who took the time and was attentive, to me, Darwin Award, please)

    Look carefully at your code:

     Coon sipffoObject = new Coon(); System.out.println(spiffoObject.runaway(20)); 

    sipffoObject and spiffoObject - look carefully (compare the spell) that they wrote :)