Java Java Basics Using your New Tools Multiple Format Strings

Kendhall Lebron Ruiz
PRO
Kendhall Lebron Ruiz
Pro Student 875 Points

readLine method.

It says to create a new variable that accepts input from the console using the readLine method, but I don't know what I'm doing wrong

Multiple.java
// I've imported java.io.Console for you.  It is stored in a variable called console for you.
String name = console.readLine(); 

1 Answer

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 49,589 Points

If you check the preview you see:

JavaTester.java:116: error: method readLine in class MockConsole cannot be applied to given types;
String name = console.readLine();
                     ^
  required: String,Object[]
  found: no arguments
  reason: actual and formal argument lists differ in length
1 error

So the checker is expecting an argument for readLine.

String name = console.readLine("Enter something");