--%>

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 Java Archive file Java Archive

    Java Archive file: It is a Java Archive (JAR) file which makes it possible to store multiple bytecode files within a single file.

  • Q : What is Java What is Java: It is a

    What is Java: It is a portable high level programming language introduced by Sun Microsystems.

  • Q : Explain Method overriding Method

    Method overriding: It is a method stated in a super class might be overridden by a method of similar name stated in a sub class. The two methods should have similar name and number and types of formal arguments. Any checked exception thrown by sub-cla

  • Q : What is Parsing Parsing : Generally

    Parsing: Generally applied to the action of a compiler in examining a program source file for syntax errors. This is too employed more broadly to mean the analysis of the structure of input.

  • Q : Explain the differences among SEI

    What in your advice are the most important fundamental differences among SEI SW-CMM and ISO 9000-3?

  • Q : How Java client access Corba A Corba

    A Corba remote object exists. How could you get a Java client to access this object?

  • Q : What is Reader class Reader class : It

    Reader class: It is sub-class of the Reader abstract, stated in the java.io package. Reader classes translate input from the host-dependent character set encoding into the Unicode.

  • Q : Define Assembler Assembler : The

    Assembler: The program employed to translate a program which is written in assembly language into the binary form of a specific instruction set.

  • Q : Explain Multiple inheritance Multiple

    Multiple inheritance: The capability of a class or interface to expand more than one interface or class. In Java, multiple inheritance is only accessible in the circumstances which are shown below: An interf

  • Q : Explain Throw statement Throw statement

    Throw statement: It is a statement employed to throw an exception. For example:     throw new IndexOutOfBoundsException(i+" is too large.");