Well I got the whole substring thing working.. thanks a lot. Now I've gotta struggle with the "stdin.readline()" which doesn't wanna work for some odd reason :P I imported the java.io.* i created a new BufferedReader ... and it just doesn't wanna work.

Are there any other ways of getting input from a user. In c++ it was just CIN and that WAS SOOOO MUCH EASIER than screwing around with all of these buffered readers :P

Any ideas?

Recommended Answers

All 3 Replies

It would have helped to have the code posted but I'll post some code with the bufferedReader that does work to hopefully help you...

import java.io.*;

class Poop
{
	public static void main(String[] args) throws IOException 
	{
	  BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	  String inData;
	  int count = 0;
	  
	  do
	  {
	    
	    System.out.println("Enter some text");
	    inData = br.readLine();
	    count++;
	}
	

	while  (!inData.equals(""));
		System.out.println("You were promted: " + count + " times");
	
        }
}
}

What version of Java are you using? 1.4.2 0r 1.5.0

Jeremy

What version of Java are you using? 1.4.2 0r 1.5.0

Jeremy

As he stated above it might be the sdk your using. If your using an older version like me you will use the BufferedReader. If you use sdk 1.5 they got some Scanner() method or something in place of the BufferedReader.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.