Skip to main content

Java Objects and Classes

  • Chapter
Mastering Java

Part of the book series: Macmillan Master Series

  • 506 Accesses

Abstract

C++ added object-oriented programming onto C. This allows the language to contain non object-oriented code and object-oriented code. Java differs in that it is completely object-oriented. This chapter discusses the main parts of object-oriented design, that is:

  • Classes. This is a collection of data and methods that operate on the data.

  • Objects. This is a created instance of a class which contains its own class data.

  • Methods. These are used to operate on objects and are equivalent to procedures (in Pascal) and functions (in C).

  • Constructors. These are used to initialise an instance of a class.

  • Method overloading. These are used to define a method which has different parameters passed to it.

  • Garbage collection. This is used to clean-up unused objects.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Author information

Authors and Affiliations

Authors

Copyright information

© 1998 William Buchanan

About this chapter

Cite this chapter

Buchanan, W. (1998). Java Objects and Classes. In: Mastering Java. Macmillan Master Series. Palgrave, London. https://doi.org/10.1007/978-1-349-14772-4_4

Download citation

  • DOI: https://doi.org/10.1007/978-1-349-14772-4_4

  • Publisher Name: Palgrave, London

  • Print ISBN: 978-0-333-73008-9

  • Online ISBN: 978-1-349-14772-4

  • eBook Packages: EngineeringEngineering (R0)

Publish with us

Policies and ethics