Interface and implementation

CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.

Bruce Eckel’s Thinking in Java Contents | Prev | Next

We’re
now in the world of object-oriented programming, where a
class
is actually describing “a class of objects,” as you would describe
a class of fishes or a class of birds. Any object belonging to this class will
share these characteristics and behaviors. The class is a description of the
way all objects of this type will look and act.

The
class is the fundamental OOP concept in Java. It is one of the keywords that
will
not
be
set in bold in this book – it becomes annoying with a word repeated as
often as “class.”

public class X {
  public void pub1( ) { /* . . . */ }
  public void pub2( ) { /* . . . */ }
  public void pub3(&nbsp;) { /* . . . */ } <p><tt>  private void priv1(&nbsp;) { /* . . . */ } </tt></p><p><tt>  private void priv2(&nbsp;) { /* . . . */ } </tt></p><p><tt>  private void priv3(&nbsp;) { /* . . . */ } </tt></p><p><tt>  private int i; </tt></p><p><tt>  // . . . </tt></p><p><tt>}</tt></p>

More by Author

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Must Read