CSE 214 Chapter Notes - Chapter 2: Java Package, Instance Variable, Mutator Method

47 views4 pages

Document Summary

Chapter 2 - java classes and information hiding page 1. Chapter 2 - java classes and information hiding page 2. Chapter 2 - java classes and information hiding page 3. In java, object-oriented programming (oop) is supported by implementing classes. Each class defines a collection of data, called its instance variables. In addition, a class has the ability to include two other items: constructors and methods. Constructors are designed to provide initial values to the class"s data; methods are designed to manipulate the data. Taken together, the instance variables, constructors, and methods of a class are called the class members. We generally use private instance variables and public methods. This approach supports information hiding by forbidding data components of a class to be directly accessed outside of the class. A new class can be implemented in a java package that is provided to other programmers to use.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions