Mapa mental
FirstTask
Contenido del mapa
FirstTask
Fields: the "attributes" of an object
- these are variables of the object. fields can also be other classes (ex. an Employee class might have an address field of type Address, where Address is its own, different class). the names of fields capitalize the first letter of every word except the first word (ex. "fieldName")
Methods: the different actions the object can perform, has two parts (declaration and body)
- declaration: consists of a return value, the method name, and a list of arguments
- formula of a declaration: returnType methodName (listOfArguments)
- body: contains code that performs the action
- the Main Method: the entry point of the application, only one class has to have a main method
- formula: public static void main (String[] args)
- declaration: consists of a return value, the method name, and a list of arguments
Classes: blueprints/templates that all objects fall within, they define the objects and are the fundamental building blocks of a program in Java
- general formula for classes can be found on page 77-78 of textbook
- class className { [content of the class] }
- class names have capital first letters for every word (ex. "ClassName"), class definitions must be saved in a file with the same name plus .java (ex. "ClassName.java")
- constructors: every class must have at least 1 of these, it has no return value, must have same name as the class
- general formula for classes can be found on page 77-78 of textbook
Información
- Descripción
- Mapa Mental sobre FirstTask, creado por Zack Attack el 15/09/2020.
- Creado por
- Zack Attack
- Visitas
- 0
- Valoración