Results 1 to 11 of 11
  1. #1
    Sniper-X is offline Member
    Join Date
    May 2008
    Posts
    3
    Rep Power
    0

    Default System.out.println

    i am designing a program using Blue J and for some reason i cant use System.out.println. It says it cant find the variable out, can someone PLEASE HELP!!!

  2. #2
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    10

    Default

    how did you use the System.out.println?

    If you made like System.out.println(out);
    Be sure you have the out variable.

    If you just want to print a word "out",

    System.out.println("out");

    Or, show us your code including the stackTrace( the error )
    freedom exists in the world of ideas

  3. #3
    Sniper-X is offline Member
    Join Date
    May 2008
    Posts
    3
    Rep Power
    0

    Default this is the code i used

    /**
    * Add applicants to the system.
    */
    public void addApplicant (Person newPerson)
    {
    if(persons.size() == capacity) {
    System.out.println("All advisors are busy, please come back later." );
    }
    else {
    persons.add(newPerson);
    }
    }

    This is the code i used and it doesnt work can u help

  4. #4
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    10

    Default

    This kind of error is new to me....

    Just to confirm, can you show the whole error (StackTrace)?

    I think printing to console is not the problem,
    Just to confirm
    freedom exists in the world of ideas

  5. #5
    Sniper-X is offline Member
    Join Date
    May 2008
    Posts
    3
    Rep Power
    0

    Default Heres the whole problem

    import java.util.*;
    import java.lang.String.*;


    /**
    * The System basically put's the information of all the people looking for work
    * and all their details are on the system.
    *
    * @Author RioAntonio Drayton
    * @Version 2008.04.04
    */

    public class System
    {
    private String advisor;
    private String desk;
    private String timeAndDay;
    private List <Person> persons;
    private int capacity;

    /**
    * This creates a new system with the number of applicants. Some details
    * are set to unknown.
    */

    public System (int numberOfApplicants)
    {
    advisor = "unknown";
    desk = "unknown";
    timeAndDay = "unknown";
    persons = new ArrayList<Person>();
    capacity = numberOfApplicants;
    }



    /**
    * Add applicants to the system.
    */
    public void addApplicant (Person newPerson)
    {
    if(persons.size() == capacity) {
    System.out.println("All advisors are busy, please come back later." );
    }
    else {
    persons.add(newPerson);
    }
    }

    /**
    * Return the number of apllicants thats registered details.
    */
    public int numberOfApplicants()
    {
    return persons.size();
    }

    }

  6. #6
    danielstoner's Avatar
    danielstoner is offline Senior Member
    Join Date
    Apr 2008
    Location
    Canada
    Posts
    191
    Rep Power
    10

    Default

    Please post the exact error message and tell us more about what you do. Are you writing an applet? Then you don't actually have an "out".
    Daniel @ [www.littletutorials.com]
    Language is froth on the surface of thought

  7. #7
    Zosden's Avatar
    Zosden is offline Senior Member
    Join Date
    Apr 2008
    Posts
    384
    Rep Power
    10

    Default

    Its either something like daniel said or you didn't install java correctly.
    My IP address is 127.0.0.1

  8. #8
    rjuyal's Avatar
    rjuyal is offline Senior Member
    Join Date
    Mar 2008
    Location
    Delhi, India
    Posts
    194
    Rep Power
    10

    Default Blue J

    have u configured your Blue J correctly?
    i am the future

  9. #9
    Jesdisciple is offline Member
    Join Date
    May 2008
    Posts
    22
    Rep Power
    0

    Default

    It's trying to use his System class. He needs to use java.lang.System.out.println().

  10. #10
    danielstoner's Avatar
    danielstoner is offline Senior Member
    Join Date
    Apr 2008
    Location
    Canada
    Posts
    191
    Rep Power
    10

    Default

    LOL, this was funny, I didn't notice the name collision :) hahaha. Good catch Jesdisciple. This only proves again one should look at the problem before giving advice... and also start with the simple things first:)
    Daniel @ [www.littletutorials.com]
    Language is froth on the surface of thought

  11. #11
    Jesdisciple is offline Member
    Join Date
    May 2008
    Posts
    22
    Rep Power
    0

    Default

    Yup, that's like the programmer's lifelong struggle: Make sure it's plugged up first. (BTW, I've been getting a kick out of this, too.)

Similar Threads

  1. System.out.println
    By sunjavaboy in forum Advanced Java
    Replies: 3
    Last Post: 03-22-2008, 02:30 AM
  2. Template for System.out.println
    By eva in forum Eclipse
    Replies: 3
    Last Post: 01-05-2008, 01:46 PM
  3. Replies: 2
    Last Post: 11-24-2007, 07:25 AM
  4. System.out.println shortcut
    By ravian in forum Eclipse
    Replies: 2
    Last Post: 11-07-2007, 11:17 AM
  5. Help me with system.out.println
    By baltimore in forum New To Java
    Replies: 1
    Last Post: 07-31-2007, 08:30 PM

Posting Permissions

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