I have recently come in touch with the JAVA and I was wondering if somebody can help me with the console window code.

Thanks in advance

P.S - Also, when typing the code into the JBuilder, where does it go? Does it go straightafter:

package XX;

Thanks,

I don't think I'm understanding do you mean like a GUI?

I have recently come in touch with the JAVA and I was wondering if somebody can help me with the console window code.

Thanks in advance

P.S - Also, when typing the code into the JBuilder, where does it go? Does it go straightafter:

package XX;

Thanks,

Here code for console window, and yes it goes after all packages declarations, and imports:

class Hello
{
  public static void main(String[] args)
  { 
      [B]System.out.println[/B]("Hello");  //prints out at command line
   }
}

Note: Please don't start out learning java under the help of a IDE(JBuilder), it will make you an extremely lazy programmer(As I know from experience), and you won't always have the chance to use something other than the console. Start out using a simple text editor, set environment variables, and then compile using the command line.

Thank you for your reply.

I knew that but then, what does this code mean?

c.input.readChar() - where c is a ConsoleWindow

Thanks in advance.

Don't think the System class has a method like that. Your probably reading a FileInputStream's method of reading a character.

Now, if you want to get input from the console, which is what it looks like:

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

br.readLine();

but other than that, I don't think you have the correct code, unless you want to post the whole thing, and maybe it's something different.

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.