In the previous chapter, you learned about classes, methods, and interfaces. In this chapter, we explore various aspects of a class and its members (variables and methods). You will learn how to organize your classes into an application. You will also learn what can happen to variables when you pass them as arguments in a method call. Another important issue covered in this chapter is from where in the application you can access a class or its members. This depends upon the access modifiers assigned to a class or its members. Modifiers modify (further specify) the behavior of a class or its members, and you can specify them when you write the code. Finally, you’ll learn how memory management is performed in Java. You instantiate a class into an object, and the object occupies some memory. You can free the memory from the object when you no longer need it, which is called garbage collection in Java.
KeywordsGarbage Collection Access Modifier Class Member Source File Java Virtual Machine
Unable to display preview. Download preview PDF.