Mapa mental
Java Building Blocks

Conteúdo do mapa
Java Building Blocks
Java Class Structure
- Fields and Methods
- fields, more generally known as variable
- methods, often called functions or procedures
- Variables hold the state of the program, and methods operate on that state
- Comments
- single-line comment
- A multiple-line comment
- Javadoc comment
- Fields and Methods
Writing a main() Method
- A main() method is the gateway between the startup of a Java process, which is managed by the Java Virtual Machine (JVM), and the beginning of the programmer’s cod
- Rules
- The method must be marked as a public method.
- The method must be marked as a static method
- The name of the method must be main
- The return type of this method must be void.
- The method must accept a method argument of a String array or a variable argument (varargs) of type String
Understanding Package Declarations and Imports
- . Java puts classes in packages. These are logical groupings for classes.
- Java classes are grouped into packages
- RULES TO REMEMBER
- Here are a few of important rules about packages: ■ Per Java naming conventions, package names should all be in lowercase. ■ The package and subpackage names are separated using a dot (.). ■ Package names follow the rules defined for valid identifiers in Java. ■ For classes and interfaces defined in a package, the package statement is the first statement in a Java source file (a .java file). The exception is that comments can appear before or after a package statement. ■ There can be a maximum of one package statement per Java source code file (.java file). ■ All the classes and interfaces defined in a Java source code file are defined in the same package. They can’t be defined in separate packages
- Wildcards
- The * is a wildcard that matches all classes in the package
- Redundant Imports
- Naming Conflicts
- This means you’ll sometimes want to import a class that can be found in multiple places
Imagens e arquivos do mapa
Informações
- Descrição
- Computación e Informática Mapa Mental sobre Java Building Blocks, criado por Ericka Montero em 11-03-2020.
- Criado por
- Ericka Montero
- Visualizações
- 0
- Avaliação