Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialNikhil Sharma
1,173 Pointsis that problem with you
i think its true , but whats that error
package com.example;
public class BlogPost{
public static void main(String[] args)
}
import com.example.BlogPost;
public class Display {
public static void main(String args[])
{
BlogPost blog = new BlogPost();
System.out.println("This is a blog post : %s",blog);
}
// Your code here...
}
2 Answers
jacobproffer
24,604 PointsHey Nikhil,
As mentioned in the prompt, leave the BlogPost class blank. You currently have:
package com.example;
public class BlogPost{
public static void main(String[] args)
}
What you want is this:
package com.example;
class BlogPost {}
You also want to use printf and not println:
import com.example.BlogPost;
public class Display {
public static void main(String[] args) {
// Your code here...
BlogPost post = new BlogPost();
System.out.printf("This is a blog post: %s", post); // Be sure to use printf and not println
}
}
With that being said, think about why having public static void main(String[] args) in your BlogPost class would cause an error.
Nikhil Sharma
1,173 Pointsyeah got that ! thanks for response