my dog learned polymorphism*
The moose likes Beginning Java and the fly likes Design and implement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Design and implement" Watch "Design and implement" New topic
Author

Design and implement

Clare Wright
Greenhorn

Joined: Jun 06, 2006
Posts: 11
Hi,

Very new to java so sorry if this sounds stupid. Doing some exercises - if the question says Design and Implement a class, do you create a ClassName.java file in which your class is designed and implemented? I remember doing C++ where the class definition was a separate file and the implementation in another file.

Thanks.
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11256
    
  16

in java, everything for a class goes into one file. you cannot split a single class over two files.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Clare Wright
Greenhorn

Joined: Jun 06, 2006
Posts: 11
much appreciated. now i can move ahead!
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14114
    
  16

"Design" means: think about how your class is going to look, what member variables and methods are you going to put into it. You can do this in your head, or on paper perhaps.

"Implement" means: use a text editor or IDE to write the actual Java code for the class.

The "design" part is more thinking than typing, and the "implement" part is more typing than thinking.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Clare Wright
Greenhorn

Joined: Jun 06, 2006
Posts: 11
thanks Jesper. My textbook seems to be dealing with GUIs at the very end I think if they were introduced first it might have made things clearer. But who am I to judge I'm a baby greenhorn.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38479
    
  23
dealing with GUIs at the very end
That is the way we usually work in Java; we start with apps which run from a command prompt or shell (such tools and BlueJ and IDEs simply emulate a command prompt to start a class).

We get to GUIs later on, in the first instance coding by hand rather than doing what you do in VB or C# where you assemble a GUI from a palette.
Clare Wright
Greenhorn

Joined: Jun 06, 2006
Posts: 11
Yes I'm starting to get that - feeling a lot better - this Big Moose Saloon really is a friendly place for beginners. Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Design and implement