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 5. Core Classes

Chapter 5. Core Classes

Before we study other features of object-oriented programming (OOP), let's examine several important classes that are commonly used in Java. These classes are included in the Java core libraries that come with the JDK. Mastering them will help you understand the examples that accompany the next OOP lessons.

The most prominent class of all is definitely java.lang.Object. However, it is hard to talk about this class without first covering inheritance, which we will do in Chapter 6, "Inheritance." Therefore, java.lang.Object is only discussed briefly in this chapter. Right now we will concentrate on classes that you can use in your programs. We'll start with java.lang.String and other types of strings: java.lang.StringBuffer and java.lang.StringBuilder. Then, we'll discuss arrays and the java.lang.System class. The java.util.Scanner class is also included here because it provides a convenient way to take user input.


  

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