|
|
|
|
Welcome to the Java Forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:
- have access to post topics
- communicate privately with other members (PM)
- not see advertisements between posts
- have the possibility to earn one of our surprises if you are an active member
- access many other special features that will be introduced later.
Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact us.
|
|

05-04-2008, 06:28 PM
|
|
Member
|
|
Join Date: May 2008
Posts: 3
|
|
|
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!!!
|
|

05-04-2008, 06:35 PM
|
 |
Senior Member
|
|
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 324
|
|
|
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 )
__________________
best regards, 
sukatoa
|
|

05-04-2008, 07:06 PM
|
|
Member
|
|
Join Date: May 2008
Posts: 3
|
|
|
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
|
|

05-04-2008, 07:17 PM
|
 |
Senior Member
|
|
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 324
|
|
|
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
__________________
best regards, 
sukatoa
|
|

05-04-2008, 08:34 PM
|
|
Member
|
|
Join Date: May 2008
Posts: 3
|
|
|
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();
}
}
|
|

05-04-2008, 09:26 PM
|
 |
Senior Member
|
|
Join Date: Apr 2008
Location: Canada
Posts: 141
|
|
|
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".
|
|

05-04-2008, 10:20 PM
|
 |
Senior Member
|
|
Join Date: Apr 2008
Posts: 221
|
|
|
Its either something like daniel said or you didn't install java correctly.
__________________
Definition of Impossible = making a good game in Java.
|
|

05-05-2008, 12:54 PM
|
 |
Senior Member
|
|
Join Date: Mar 2008
Location: Delhi, India
Posts: 129
|
|
|
Blue J
have u configured your Blue J correctly?
__________________
Newton said Gravitaion, Rakesh says Earth Sucks
|
|

05-05-2008, 03:10 PM
|
|
Member
|
|
Join Date: May 2008
Posts: 22
|
|
|
It's trying to use his System class. He needs to use java.lang.System.out.println().
|
|

05-05-2008, 03:52 PM
|
 |
Senior Member
|
|
Join Date: Apr 2008
Location: Canada
Posts: 141
|
|
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 
|
|

05-05-2008, 04:41 PM
|
|
Member
|
|
Join Date: May 2008
Posts: 22
|
|
|
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.)
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
All times are GMT +3. The time now is 02:43 AM.
|
|
VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org