aspose file tools*
The moose likes Beginning Java and the fly likes Need some urgent help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Need some urgent help" Watch "Need some urgent help" New topic
Author

Need some urgent help

jon ladd
Ranch Hand

Joined: Feb 11, 2003
Posts: 53
I need some help i am lost i am getting alot of errors. Right now if you looked at it there ar some errors with the cases I know that. I am having trouble with "x[0] = new Names("Jim", new StringBuffer("CIS"), 15);" it gives me errors about that x in not in the student class.
It also gives me errors with Sets down farther.
If this is to confusing, I can post the whole program with all the cases. But the assigment is confusing too look at becase were are modifying are last program.

Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Will you please paste the exact error messages?


Java API Documentation
The Java Tutorial
William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 986

Your setMajors method never actually does an assignment.


Please ignore post, I have no idea what I am talking about.
William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 986

How do you know what your code is actually doing? Put LOTS of print statements, everywhere, that is how you know. And is one the most important steps of development. You can take them out once you get everything working. (If you have a debugger that is even better.)
jon ladd
Ranch Hand

Joined: Feb 11, 2003
Posts: 53
OK thanks fo the help.
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1817

Also, just looking at your code, you state x[0] = new Names etc., but I don't see where you are declaring you array x. What sort of array is it?


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
jon ladd
Ranch Hand

Joined: Feb 11, 2003
Posts: 53
Ok thanks for pointing that out I can not believed I missed that I guess that I was creating an array by having x[0] = new Names("Jim", new StringBuffer("CIS"), 15);. Ok if I put one of these below with that initialize the array. I think that how I want to say it
x[] Names = new x[3];
or would it be
x[] Names = new Names[3];
then go on to this down below
CODE]
x[0] = new Names("Jim", new StringBuffer("CIS"), 15);
x[1] = new Names("Shania", new StringBuffer("ACT"), 35);
x[2] = new Names("Faith", new StringBuffer("MKT"), 13);
[/CODE]
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1817

Originally posted by jon ladd:

x[] Names = new x[3];
or would it be
x[] Names = new Names[3];

Neither. You want

or

both will work; one syntax is kept for C programmers used to their syntax (I forget which is which; I use the former).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need some urgent help