Chapter 7 - Classes and methods III: Static methods and variables. In this chapter we will: describe user-defined classes instance variables, constructors, instance methods; present several examples of classes; discuss the concepts of mutability and visibility; describe method overloading. | Chapter 7 Classes and Methods III: Static Methods and Variables Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by . Kamin, D. Mickunas, E. Reingold Chapter Preview In this chapter we will: describe user-defined classes instance variables constructors instance methods present several examples of classes discuss the concepts of mutability and visibility describe method overloading Object-Oriented Programming OOP supports the view that programs are composed of interacting objects Objects are composed of values known as attributes or instance variables operations (actions) that can be performed on these values know as instance methods Messages requesting an action or value are sent to objects Objects respond to messages that are in their protocols or interfaces Objects Encapsulate data values within a single entity Their behavior is often general enough to allow reuse in a variety of situations Often form a basis from which other objects can be derived using a mechanism known as inheritance Are a type container that is stored on the system heap A client is program that uses an object Client Rights To declare variables of the class type To create instances of the class using constructors To send messages to instances of the class by invoking class instance methods To know the class public interface instance method names parameter number and types return types To know the instance methods that alter (mutate) the instance Class Rights To define the class public interface To hide all the implementation details from the client To protect internal data from client access To change implementation details at any time, provided the public interface remains intact To change the public interface with client concurrence Revised Class Definition public class name { declarations of instance variables constructor definitions method definitions } Every class needs one or more constructor definitions Revised Class Definition Instance . | Chapter 7 Classes and Methods III: Static Methods and Variables Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by . Kamin, D. Mickunas, E. Reingold Chapter Preview In this chapter we will: describe user-defined classes instance variables constructors instance methods present several examples of classes discuss the concepts of mutability and visibility describe method overloading Object-Oriented Programming OOP supports the view that programs are composed of interacting objects Objects are composed of values known as attributes or instance variables operations (actions) that can be performed on these values know as instance methods Messages requesting an action or value are sent to objects Objects respond to messages that are in their protocols or interfaces Objects Encapsulate data values within a single entity Their behavior is often general enough to allow reuse in a variety of situations Often form a basis from which other objects can be