
Rafał Stasiak
3,762 PointsAfter uncomment ther is syntax error.
Hello, After rechecking work I get below syntax error. Can someone help with fixing my code?
./Main.java:11: error: constructor Forum in class Forum cannot be applied to given types; Forum forum = new Forum("Java"); ^ required: no arguments found: String reason: actual and formal argument lists differ in length Note: JavaTester.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error
1 Answer

Daniel Turato
Java Web Development Techdegree Graduate 30,107 PointsA few things, make sure you uncommented the code in Forum. Also, the author object needs to be created by using the values passed in args like so:
Forum forum = new Forum("Java");
// TODO: pass in the first name and last name that are in the args parameter
User author = new User(args[0], args[1]);
// TODO: initialize the forum post with the user created above and a title and description of your choice
ForumPost post = new ForumPost(author, "test", "test");
forum.addPost(post);

Rafał Stasiak
3,762 PointsHello Daniel,
I created new post with all my code. Please look on this
Rafał Stasiak
3,762 PointsRafał Stasiak
3,762 Pointspublic class Main {
public static void main(String[] args) { System.out.println("Beginning forum example"); if (args.length < 2) { System.out.println("Usage: java Main <first name> <last name>"); System.err.println("<first name> and <last name> are required"); System.exit(1); }
}
}