Results 1 to 4 of 4
  1. #1
    shi
    shi is offline Member
    Join Date
    Dec 2015
    Posts
    4
    Rep Power
    0

    Question Write the code in console

    My professor told me that the assignment must be done using the console.

    I really don't know how I should do that. I am using bluej to write my codes.And I downloaded java development kit.


    Does anybody can help me here?

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,001
    Rep Power
    33

    Default Re: Write the code in console

    System.out.print statements write to the console.

    The Scanner class can read from the console by using System.in the the Scanner class's constructor.
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,423
    Blog Entries
    7
    Rep Power
    27

    Default Re: Write the code in console

    To add to Norm's remark (see above): that only works if you start your Java class with the 'java.exe' program (if you are on Windows); the javaw.exe program doesn't use a console; so, start your class in a console as 'java YourClass' and you are in business ...

    kind regards,

    Jos
    Build a wall around Donald Trump; I'll pay for it.

  4. #4
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: Write the code in console

    Hmm, when I first read this I thought the teacher wanted them to use the console to write the code using the console
    and CLI (as opposed to an IDE). This would force them to use a text editor and understand packages and class locations.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

Similar Threads

  1. Write a paragraph multiline paragraph with scanner console?
    By moreCowbell in forum Advanced Java
    Replies: 5
    Last Post: 03-13-2013, 02:57 PM
  2. Auto-completion of code when when I write code
    By nutzu2011 in forum Eclipse
    Replies: 0
    Last Post: 04-06-2012, 07:01 PM
  3. Need help to write the code
    By Galichka in forum New To Java
    Replies: 24
    Last Post: 03-27-2012, 04:39 PM
  4. Write XML-Code to console with SAX
    By enne87 in forum XML
    Replies: 6
    Last Post: 11-21-2010, 01:43 AM
  5. Replies: 1
    Last Post: 07-24-2007, 02:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •