Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

instructors solution for OOP-4

 
Timo Richter
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Marilyn for the final nitpick on OOP-4 (Lookup) I tried to run the instructors solution but it didn't compile due to multiple public classes existing in the source file 'Lookup.java':

My question:
Was it intended to divide the code, to create separate source-files for the classes Thing, Video, BookOnTape and Furniture and to compile then separately (this way it works on my machine)?

Regards
Timo
 
Pauline McNamara
Sheriff
Posts: 4012
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep, you got it.


Oops, almost forgot... congratulations on getting through the OOPs part of the Cattle Drive!
[ October 22, 2007: Message edited by: Pauline McNamara ]
 
Marilyn de Queiroz
Sheriff
Posts: 9063
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For convenience, it appears to be all in one file when we send assignments and solutions back and forth. However, in my opinion, it is better to keep one file per outer class.
 
Timo Richter
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you both. However this was the first time for me to recognize that I declared my outer classes with the (implicit) package access modifier that keeps the whole thing running in one file as well as the compiler refuses to accept several public (means outer) classes in one .java file.

On to these servlets...

Regards
Timo
[ October 23, 2007: Message edited by: Timo Richter ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic