Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

public/private Methods in assignment

 
Sandra Baker
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am about to wrap up my assignment, and found that almost all methods in my FlightBooking application classes only need to be private. In another word, they are application-specific methods, not really usable for other applications (not like Data class). Does this look right to you?
If private methods are okay, then, I am confused what the javadoc would look like, since only those Data class/DataServer class related methods are public to be shown in the javadoc API.....
I am really worried.... any help would be very very appreciated....TIA
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I had some doubts about this too when I submitted my assignment. I had programmed everything in a way that seemed very natural to me:
everything that is only needed from within the class is private, everything needed by other classes is public.
I took the easy way out and just left it as it was, and I passed !
I don't think the assignments are graded to such a low level (Sun has to grade too many to do that in my opinion).
More important is a rational, clear and consistent divisioning of functionality in classes and packages, I think.
hope this lightens your worries. I know pushing that "Submit assignment" button is something very stressing ...
regards,
G´┐Żnther.
http://www.javacoding.net
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic