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

Notas

Sem título

Ruma Jreij Inglês 1 página

Sem título

Conteúdo das notas (1)

Página 1

Note: Be careful about the difference between an empty string, and a null reference. An empty string is an object that contains no characters, and so has length 0. A null reference means there is no object present.

(Review:) what is the difference between a class and an object?

A class is a description of a possible object.

An object is a unique instance of a class.

Or you could say that a class is a plan for an object and an object is what results when the plan has been carried out.

JAVA CONSTRUCTORS

The Java interpreter starts a program by looking for a static main()method inside of the HelloTester.class file. Since the method is static the interpreter can run it without first constructing an object.

It is convenient to have a separate class that serves no other purpose than to contain the main() method. This testing class is used to start things running. Sometimes the class that contains main() is called a driver.

Usually main() constructs objects of various classes and calls their methods. These objects do the real work of the program.

The speak() method is part of an object. It exists only when there is an object to contain it (unlike a static method that does not need an object). The picture shows the action as step 3 starts.

The variable anObject refers to the object that was constructed. That object contains the speak() method. So main() can find and activate speak() with:

anObject.speak(); (SEE BELOW IMAGE)

Sem título

Informações

Descrição
Notas sobre Sem título, criado por Ruma Jreij em 10-01-2018.
Criado por
Ruma Jreij
Visualizações
0
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?