--%>

Explain Constructor

Constructor: A constructor is automatically called whenever an instance of its class is formed. A constructor always has similar name as its class, and encompass no return type. For example:

public class Ship {
    public Ship(String name){
        ...
    }
    ...
}

The class with no explicit constructor consists an implicit no-arg constructor that takes no arguments and contains an empty body.

   Related Questions in Programming Languages

  • Q : Define CORBA Define CORBA ? What does

    Define CORBA? What does it do?

  • Q : Explain Window manager Window manager :

    Window manager: This is a window manager which provides a computer user with a virtual desktop having one or more windows and working regions in which individual programs might be run. Window managers permit the contents of a user's desktop to be arra

  • Q : How does XML maintain white-space in

    How does XML maintain white-space in any documents?

  • Q : Define Byte code Byte code : Java

    Byte code: Java source files are converted by a compiler into bytecodes that is, the instruction set of the Java Virtual Machine (JVM). The Bytecodes are stored in the .class files.

  • Q : Define Passing by value Passing by

    Passing by value: In this process separate memory builds for formal arguments and when any modifications done on formal variables, it will not influence the real variables. Therefore actual variables are preserved in this situation.

  • Q : Explain why java is so important for

    The internet aided java to the forefront of programming. And java consequently has had a deep effect on the internet. The reason for this is highly simple: java uses the universe of objects that can travel freely in cyber space. In a network, two broad categories of

  • Q : Explain Declaration and initialization

    Declaration and initialization: It is a statement in which a variable is declared and instantly given its initial value. Three illustrations of declaration and initialization are as follows:     int

  • Q : State the term XPath State the term

    State the term XPath?

  • Q : Define the term Marking interface

    Define the term Marking interface: It is an interface with no methods.

  • Q : What is an Object construction Object

    Object construction: The creation of an object, generally through the new operator. Whenever an object is formed, a suitable constructor from its class is summoned.