A7
暂无描述。系统推荐的高质量记忆内容,适合每天坚持背诵学习。
卡片预览 (24 张)
Access level
Determines the level of access other files have to the class data or methods
Attributes
Stores an objects data
Class
A blueprint what an object stores and how it behaves
Class attribute
The attribute is created once and it shared between all instance of the class. Class attributes can be accessed through the class name like Math.PI
Class method
Can only access class attributes, class methods can be access to the class name like math.Pow()
Constructors
Special methods used for constructing objects
Defaults constructors
A constructor 0 parameters. When a class has 0 constructors a hidden default constructor is created that will set all objects to null, booleans to false and all other primitives to 0
Encapsulation
The combining of data into a class
Equals
A method used to check equality of two objects
Final
Used to make a variable constant
Getter
A method that allows public access to a private attribute
Information hiding
When classes store their data privately prevent unwanted modifications
Instance attribute
Every instance of an object gets its own copy of the variable
Instance methods
Can access both instance and class variables. Can only be accessed via through an instance of class
Modifiers
Sets methods or attribute properties
Null
A keyword used to denote that a variable is not referencing any object
Package
A group of related classes
Private
Data cannot be accessed outside the file
Setter
A method that allows private attributions to be changed publicly
This
A keyword used to access the current instance of the class
ToString
A method used to return a text version of an object
What do public classes consist of
Other methods, default constructor, data can be modified by classes that share the same package or any subclass, setters, getters, constructors
What do private classes consist of
Data cannot be acccessed outside the file, information hiding uses this type of data, attributes
Static definition
Keyword sets an attribute or method to be a class attribute or class method