• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help with assignment please. (Object oriented programming)  RSS feed

 
Ed Palazo
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I am working on a program that I have yet to add a couple methods to.
Anyways this driver wont compile with the Student class because of this error:



What should I do?



Here is the Student class:
 
Carey Brown
Saloon Keeper
Posts: 3318
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nothing jumps out at me. Looks ok.

Are you using an IDE to develop or command line tools?
What is the directory structure holding your java files?
What directory are you in when you start the compilation?
What are you typing in to start the compilation?
 
Ed Palazo
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Carey Brown wrote:Nothing jumps out at me. Looks ok.

Are you using an IDE to develop or command line tools?
What is the directory structure holding your java files?
What directory are you in when you start the compilation?
What are you typing in to start the compilation?


omg thank you.  I am an idiot.  I didn't even think of that and I learned that last week
 
Junilu Lacar
Sheriff
Posts: 11489
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
These issues with your code jump right out at me:

1. Your Student instance fields are all declared with default (package-private) access. This mean that anything that's in the same package as the Student can change them. Not good at all -- breaks encapsulation.

2. Most comments are pointless, they don't really add anything to your program except visual clutter, which is not a good thing. Plus, some of the comments are non-standard format for what they're meant to be. For example, this

These comments ought to be JavaDoc style comments, following good JavaDoc comment style. It isn't and it doesn't.

3. Your indentation and formatting could use a little cleanup.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!