Java Java Basics Getting Started with Java Strings, Variables, and Formatting

String variable compiling in Java

Hi! Raluca here!:) I'm a beginner who wants to learn Java coding. Please tell me WHAT code line am I missing? Thank you!

Name.java
// I have setup a java.io.Console object for you named console
package java.io.Console

public class Introduction {

public static void main(String[] args) {

Console console = System.console() ;

String firstNameAndWill = "Raluca learns to code in Java";

}

}

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Staff

Hi there, Raluca Voicu ! Something to note about code challenges is that much of the surrounding code is already provided for you in the background. You do not need a main or even a class declaration. All that has been set up for you already. Secondly, you must name the variable exactly as it specifies which is firstName.

The solution to this challenge is simply one line of code.

String firstName = "Raluca";

Hope this helps! :sparkles:

I appreciate your answer, Jennifer Nordell! Wish you having a nice day further! :)