Can anyone help solve my problem? Don't know where I've gone wrong.
Main
// Main public class Nicky { public static void main(String[] args) { func f = new func("Did it work? Hehehe", 10); System.out.print(f()); } }
Other class
// functions public class func { private String TheWord; private final int TheNumber; public func(String s, final int f) { TheWord = s; TheNumber = f; } public String toString() { return String.format("The word is %s\nThe number is %d", TheWord, TheNumber); } }
And thanks for the help on the other post, should I report solve on there?
- Nicky
EDIT:
Oops, I apologize, here's the error:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method f() is undefined for the type Nicky
at Nicky.main(Nicky.java:7)