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 trialjainil jaha
Courses Plus Student 305 Pointsi cant find the problem
?
// I have setup a java.io.Console object for you named console
class unidentified
{
public static void main( string[]args);
{
Console console = System.console();
string firstName = ("jainil");
Console.printf("%s is a rockstar",firstName);
}
}
3 Answers
Moira Lawrie-Martyn
8,073 PointsYou need to be aware of where your capitalisation is. Such as when declaring a string variable, it needs a capital "S" - String.
This would mean the following should work once you've corrected the capitalisation of String, and using console instead of Console because you've declared a variable for the Console.
Sometimes I find changing the variable name useful, such as Console consReplace then I'd put in consReplace.printf
// I have setup a java.io.Console object for you named console
class unidentified
{
public static void main( String[] args);
{
Console console = System.console();
String firstName = ("jainil");
console.printf("%s is a rockstar",firstName);
}
}
Sławomir Lasik
7,792 PointsCheck out this code and see Your errors. They are so basic that u might think about writing some BASIC code on your own. Starting by printing "Hello World" using System.out.print, Console (and anything used in the courses in Treehouse). Check if they compile.
Write one line of code -> compile -> run.
When there are error messeges learn how they look and what they mean. It is in the course as well. Just practice practice.
// I have setup a java.io.Console object for you named console
import java.io.Console;
public class Unidentified
{
public static void main(String[] args)
{
Console console = System.console();
String firstName = ("jainil");
console.printf("%s is a rockstar",firstName);
}
}
abdijabar sambul
1,063 Pointsyou don't need to write all that , the task is in three part so just write what your ask simple. for example the first part of the task is asking you "Define a string variable named firstName that stores your name. Set the value to your name." so the answer is String firstName="jainil jaha"; then compile it.
NB: java is case sensitive.
Diwakar Singh
785 PointsDiwakar Singh
785 Pointsall of your code good but there are some typo