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

Design and implement

Clare Wright

Joined: Jun 06, 2006
Posts: 11

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 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.

fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11955

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

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: 15081

"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 8 API documentation
Clare Wright

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

Joined: Oct 13, 2005
Posts: 46337
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

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:
subject: Design and implement
It's not a secret anymore!