Top.Mail.Ru
October 10th, 2004 - Java developers — LiveJournal
? ?

Java developers

October 10th, 2004
 

03:05 pm - reuptake

Okay, I think I'm getting closer to understanding and completing my last assignment

The was a typo in the assignment though about the Name(): thing, it should be
Account(): configures a new account name with name "name", owner "owner", and balance "0"
Account(String s, String t, double n): configures a new account with name s, owner t, and balance n.


New Not Compiling CodeCollapse )

When I try to compile, I get an error up in my default constructor Account() that my variables (name, owner, and balance) "might not have" initialized. I'm not understanding why.

And my toString is bad too, but I don't think I can mess with that until I get the rest of it working.

Thanks for all your help!

Edit: The assignment wants the initial balance to be 0. We're adding or subtracting "n" from our balance, so I know it's wrong to have "n" be equal to 0, because that's adding and subtracting nothing. I'm thinking I'm going to have to use "new" under my default constructor, right?

03:21 pm - silx - Question..

Hello, I'm newbie here.

I've been studying Computer Science and at the moment I have Java course. Now.. don't worry, I will not ask you to write a program for me. I think I can handle them myself.
Anyways.. We are writing Java programs under Linux at school. And I honestly haven't had to to work on them at home.
So today I installed Java to my home computer and tested it on a well-working short program. Used the command prompt of Windows.. got all the folders and stuff right..
So at first the compiler (typed: javac test1.java) said that there was no errors and so then I typed

java test1

to see if the program is really working and the command prompt said:

Exception in thread "main" java.lang.NoClassDefFoundError: Test1/Java


So.. wtf?!
It says that with every program. And I really really need to get it working tonight!
What should I do.. Or what have I done wrong?!
Powered by LiveJournal.com