
-----------------------------------
Kenster102.5
Thu Sep 04, 2008 9:50 pm

So what am I doing wrong?
-----------------------------------
I am just trying to create an easy template for me to follow when it comes to inputing names, but since last year I learned Ready To Program, for some reason this year I have to learn Doctor Java, so could somebody kindly just point out what I need to change. 
Thanks 
Ken 

import java.io.*; 

public class KenName
{
  public static void main ( String args [])
  {
    String name1; 
    
    System.out.println("Who is this? Please enter name"); 
                        name1 = readLine(); /*This seems to be my problem */
                        System.out.println("This is, " + name1); 
                        
  }
  
}

-----------------------------------
rdrake
Thu Sep 04, 2008 10:01 pm

Re: So what am I doing wrong?
-----------------------------------
You're not calling readLine() on an object.  You need to make use of a BufferedReader object like [url=http://www.cs.utsa.edu/~cs1063/lectures/BufferedReaderExamples/BufferedReader.html]this example shows.

-----------------------------------
riveryu
Sun Sep 07, 2008 4:19 pm

RE:So what am I doing wrong?
-----------------------------------
Also, I think you need to label  "throws IOException" when you are using something from "java.io.*".
