O GoConqr está de visual novo! Conte para nós o que você achou.

Mapa mental

Java Class

Saketh Maganti Inglês

Conteúdo do mapa

Java Class

  1. The class name

    • A class definition must be saved in a file that has the same name as the class name
    • General Syntax: class className{ [classbody] }
    • Class names capitalize the initial of each word.
  2. The fields

    • Fields are variables. They can be primitives or references to to objects.
    • Field names also follow the camel naming convention
    • Ex. Address address;
  3. The methods

    • Methods define actions that a class's objects (or instances) can do
    • Methods have a declaration part and a body
      • The declaration consists of a return value, the method name, and a list of arguments. It is also called the signature of the method.
      • The body contains code that performs the action
    • Syntax: returnType methodName (listOfArguments)
    • The method "main"
      • The method main is a special method that provides the entry point to an application
      • Only one class can have a main method. This method allows the class containing it to be invoked.
      • Signature of main method: public static main void(String[] args)
  4. Java Classes are a blueprint or a template to create objects of an identical type.

  5. Constructors

    • Every class must have at least one constructor. Otherwise, no objects would be created out of the class.
    • Constructors are used to construct an object. If your don't define a constructor, then the compiler adds one for you.
    • A constructor looks like a method and is sometimes called a constructor method. However, it doesn't have a return value.
    • Must have the same name as the class.
    • Syntax: constructorName (listOfArgurments) { [constructor body] }
    • A constructor may have a zero argument, in which it is called a no-argument constructor
    • Constructor arguments can be used to initialize the fields in the object
  6. Objects

    • Objects have attributes and can perform actions.

Informações

Descrição
Mapa Mental sobre Java Class, criado por Saketh Maganti em 29-08-2019.
Criado por
Saketh Maganti · ago 2019
Atualizado
29 ago 2019
Visualizações
0
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?