Liutauras Vilda wrote:Also keep your instance variables private, so nobody could access them directly, but rather only through setter methods which you created already.
I would take ti for granted that you supply a constructor for every class myself, but I would delete that no‑arguments constructor. It allows somebody to instantiate your class without initialising all fields to correct values.Dave Tolls wrote:That's very good, except you weren't asked for any constructors. . . . Camel case works better than all lower case. It's easier to read.
If you do change that, don't forget to change the set and get methods names to reflect that.
Campbell Ritchie wrote:I would take ti for granted that you supply a constructor for every class myself, but I would delete that no‑arguments constructor. It allows somebody to instantiate your class without initialising all fields to correct values.
The program should be written as a single .java file (the Employee class should be included in the EDA.java file, after the EDA class definition).
All things are lawful, but not all things are profitable.
But I thought at this stage he hadn't heard of them, nor of the Bean pattern which uses the no‑arg constructor and all those setXXX and getXXX methods.Dave Tolls wrote:. . . There's a lot of tools that rely on a no args constructor.
Hibernate for example. . . .
Campbell Ritchie wrote:
But I thought at this stage he hadn't heard of them, nor of the Bean pattern which uses the no‑arg constructor and all those setXXX and getXXX methods.Dave Tolls wrote:. . . There's a lot of tools that rely on a no args constructor.
Hibernate for example. . . .
No. If I were marking, I would take off lots of marks for style because you appear to be using two statements per line. If you want good marks, you will have to past correctly indented code (following your local code conventions).Daniel Jenkins wrote:for Part 2 is this a good start? . . .
Campbell Ritchie wrote:I think Employee will compile but the other class won't.
Campbell Ritchie wrote:Just because the whole code has been posted in one pair of code tags doesn't mean it is all in the same file. So I tried it and found lots more errors I hadn't expected.
All things are lawful, but not all things are profitable.
Ok i did what you said but still I have errors on line 16 32,34,35,36,37. do you know how to fix it?
All things are lawful, but not all things are profitable.
All things are lawful, but not all things are profitable.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |