Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 25. An Overview of Java > Object-Oriented Programming

Object-Oriented Programming

Java is an object-oriented programming language. You are probably familiar with procedural programming languages in which statements are executed in order, line by line, and may be grouped into procedures that are called from the main body of code. Object-oriented programming is a new way of thinking about the structure of your program. Instead of just grouping statements into procedures, statements and procedures (called methods) are grouped into classes. To use a class, you create an instance of the class called an object. A class is like a type definition for an object.

For example, suppose you are writing a system to keep track of students enrolled at a university. You might create a class called StudentFile. It would include variables such as name and IDnum. It would also include methods such as SetStudentData and GetStudentID.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint