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 trialafra raheem
Front End Web Development Techdegree Student 38 PointsDefine a String variable Name
what is wrong in my code????
public class Name{
public static void main(String[] args);
String firstName = "Afra";
console.printf("firstName");
}
}
5 Answers
Ryan Chatterton
5,914 Pointsafra raheem what step are you on?
step 1 you just need to define your name
String firstName = "bob";
step 2 they want you to print it out with the message
String firstName = "bob";
console.printf("<YOUR NAME> can code in Java!");
Step 3 is the replace
String firstName = "bob";
console.printf(String.format("%s can code in Java!", firstName));
you don't need the class , or the main method for the challenge.
Ryan Chatterton
5,914 PointsTry: You had a ; after the method and missing a {
public class Name {
public static void main(String[] args) {
String firstName = "Afra";
console.printf("firstName");
}
}
afra raheem
Front End Web Development Techdegree Student 38 Pointsthank u Ryan......let me try
afra raheem
Front End Web Development Techdegree Student 38 PointsJavaTester.java:72: error: illegal start of expression public class Name { ^ 1 error how to solve this error??? plz help me anybody
Keli'i Martin
8,227 PointsCan you post your updated code?
afra raheem
Front End Web Development Techdegree Student 38 Pointspublic class Name { public static void main(String[] args) { String firstName = "Afra"; console.printf("firstName"); } }
afra raheem
Front End Web Development Techdegree Student 38 PointsJavaTester.java:72: error: illegal start of expression public class Name { ^ 1 error it shows like this
Keli'i Martin
8,227 PointsKeli'i Martin
8,227 PointsAre you working on Task 3 of the challenge?