tailieunhanh - Lecture Object Oriented Programing - Chapter 3: Introduction to classes and objects

Chapter 3 introduction to Classes and Objects. In this chapter you will learn: What classes, objects, methods and instance variables are; how to declare a class and use it to create an object; how to declare methods in a class to implement the class’s behaviors; how to declare instance variables in a class to implement the class’s attributes; how to call an object’s method to make that method perform its task;. | 3 Introduction to Classes and Objects You will see something new. Two things. And I call them Thing One and Thing Two. Dr. Theodor Seuss Geisel Nothing can have value without being an object of utility. Karl Marx Your public servants serve you right. Adlai E. Stevenson Knowing how to answer one who speaks, To reply to one who sends a message. Amenemope OBJECTIVES In this chapter you will learn: What classes, objects, methods and instance variables are. How to declare a class and use it to create an object. How to declare methods in a class to implement the class’s behaviors. How to declare instance variables in a class to implement the class’s attributes. How to call an object’s method to make that method perform its task. The differences between instance variables of a class and local variables of a method. How to use a constructor to ensure that an object’s data is initialized when the object is created. The differences between primitive and reference types. . | 3 Introduction to Classes and Objects You will see something new. Two things. And I call them Thing One and Thing Two. Dr. Theodor Seuss Geisel Nothing can have value without being an object of utility. Karl Marx Your public servants serve you right. Adlai E. Stevenson Knowing how to answer one who speaks, To reply to one who sends a message. Amenemope OBJECTIVES In this chapter you will learn: What classes, objects, methods and instance variables are. How to declare a class and use it to create an object. How to declare methods in a class to implement the class’s behaviors. How to declare instance variables in a class to implement the class’s attributes. How to call an object’s method to make that method perform its task. The differences between instance variables of a class and local variables of a method. How to use a constructor to ensure that an object’s data is initialized when the object is created. The differences between primitive and reference types. Introduction Classes, Objects, Methods and Instance Variables Declaring a Class with a Method and Instantiating an Object of a Class Declaring a Method with a Parameter Instance Variables, set Methods and get Methods Primitive Types vs. Reference Types Initializing Objects with Constructors Floating-Point Numbers and Type double (Optional) GUI and Graphics Case Study: Using Dialog Boxes (Optional) Software Engineering Case Study: Identifying the Classes in a Requirements Document Wrap-Up Introduction Classes Floating-Point numbers Classes, Objects, Methods and Instance Variables Class provides one or more methods Method represents task in a program Describes the mechanisms that actually perform its tasks Hides from its user the complex tasks that it performs Method call tells method to perform its task Classes, Objects, Methods and Instance Variables (Cont.) Classes contain one or more attributes Specified by instance variables

TÀI LIỆU LIÊN QUAN