Java Java Basics Getting Started with Java Strings and Variables

ALICIA WEENUM
ALICIA WEENUM
51 Points

It's giving me an error message once I complie it.

import java.io.Console;

public class Introductions {

public static void main(String[] args) {
    Console console = System.console();
    // Welcome to the Introductions program!  Your code goes below here
    console,printf("Hello, my name is Alicia\n");
    console.printf("Alicia is learning how to write Java\n");    

} }

This is what I have and then it sends me this

Picked up _JAVA_OPTIONS: -Xmx128m
Introductions.java:8: error: not a statement
console,printf("Hello, my name is Alicia\n");
^
Introductions.java:8: error: ';' expected
console,printf("Hello, my name is Alicia\n");
^
2 errors

2 Answers

Ryan Groom
Ryan Groom
17,042 Points

ALICIA WEENUM I believe your issue is that you have a comma instead of a period in your first console.printf() statement... let me know if this fixes your issue.

Aziz Deghais
Aziz Deghais
4,546 Points

You also have to save the file before compiling it !