1. Trang chủ
  2. » Sinh học

Lập trình hướng đối tượng: Session 5 - Class Basics

7 11 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 7
Dung lượng 108,93 KB

Nội dung

– Modifier operators change the state of the leftmost operand in the expression. Modifier operators are ideal candidates for[r]

(1)

Session 5- Class Basics Contd

Normal Member Functions

(2)

Session – Class Basics

contd 2/34

Objectives

Normal Member Functions

– Implicit Parameters – Queries

– Modifiers – this

Overloaded Member Functions

– Constructors – Operators

(3)

Objectives…

Helper Functions

– Operand Symmetry – Friends

• Friend Functions • Friend Classes

– Helpers

(4)

Session – Class Basics

contd 4/34

Normal Member Functions

• An object communicates with the outside world through queries and modifiers

• Queries and modifiers are member functions of the object's class

(5)

Implicit Parameters

• Each member function has direct access to all members of its class, including

private members

• There is no need to pass the values of these instance variables through a

(6)

Session – Class Basics

contd 33/34

Helpers(3)

• Overloaded operators are either modifiers or helpers

– Modifier operators change the state of the leftmost operand in the expression

Candidates include +=, -=, *=, /=, =, ++, and Modifier operators are ideal candidates for

member functions

(7)

Summary

Normal Member Functions

– Implicit Parameters – Queries

– Modifiers – this

Overloaded Member Functions

– Constructors – Operators

– Pre-Fix Operators – Post-Fix Operators

Q&A

Helper Functions

– Operand Symmetry – Friends

• Friend Functions • Friend Classes – Helpers

Ngày đăng: 09/03/2021, 05:31

w