Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: Code not working

  1. #1
    Junior Member
    Join Date
    Mar 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Code not working

    PLEASE HELP ME.I am currently readinp an online text book on java programming. The autor of the book wrote a class which he called TEXTIO but it does not work when i try using it and that is because it is not built into the java package. The problem is how do i mak


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Code not working

    Read more of the book to see if there is a place you can download the definition for the class from.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Mar 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Please why is this code not working

    public class PrintSquare { public static void main(String[] args) { // a program that computes and prints the square // of a number input by the user. int userInput; // the number input by the user int square; // the userInput, multiplied by itself TextIO.put("Please type a number: "); userInput = TextIO.getInt(); square = userInput * userInput; TextIO.put("The square of that number is "); TextIO.putln(square); } // end of main() } //end of class PrintSquare

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Please why is this code not working

    Please edit the post and format the code so it is readable. What you've posted is very hard to read and understand. No one writes code like that.

    Also wrap your code with
    [code=java]
    <YOUR CODE HERE>
    [/code]
    to get highlighting and preserve formatting.

    Then explain what "not working" means.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Member
    Join Date
    Sep 2012
    Posts
    128
    Thanks
    1
    Thanked 14 Times in 14 Posts

    Default Re: Please why is this code not working

    Where is TextIO defined?

  6. #6
    Super Moderator curmudgeon's Avatar
    Join Date
    Aug 2012
    Posts
    1,130
    My Mood
    Cynical
    Thanks
    64
    Thanked 140 Times in 135 Posts

    Default Re: Code not working

    Petrejonn, I've merged your two threads together. Please only one thread on the forum per question.

Similar Threads

  1. Please help, my inventory code is not working
    By ggarrett in forum What's Wrong With My Code?
    Replies: 9
    Last Post: January 17th, 2013, 06:39 AM
  2. How to Translate working code into code with a Tester Class
    By bankoscarpa in forum What's Wrong With My Code?
    Replies: 6
    Last Post: October 15th, 2012, 02:13 PM
  3. Code not working on other machines
    By Coty0010 in forum Java Theory & Questions
    Replies: 14
    Last Post: April 3rd, 2012, 05:33 PM
  4. Why isn't this code working?
    By tai8 in forum What's Wrong With My Code?
    Replies: 33
    Last Post: March 12th, 2012, 03:23 PM
  5. My code is not working
    By mike2452 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: August 9th, 2011, 06:17 AM