--%>

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 : What is Single inheritance Single

    Single inheritance: In Java, a class might not extend more than one class. It means that Java has a single inheritance model for the class inheritance.

  • Q : What is Static initializer Static

    Static initializer: An initializer prefixed with ‘static’ reserved word. The static initializer is stated outside the methods of its enclosing class, and might access only the static fields and methods of its enclosing class.

  • Q : Program to Calculate Estimate

    Collaboration Policy Collaboration between students on programming assignments is NOT allowed under any circumstances - you may not even discuss your work with other

  • Q : Difference between the choice and list

    Illustrate the difference between the choice and list?

  • Q : Define the term createWindow object

    Define the term createWindow object? Answer: reateWindow() physically makes the Window in memory  based upon the earlier registered WND

  • Q : Are you sure that XHTML element name

    Are you sure that XHTML element name case sensitive? Answer: XHTML element names surely are case sensitive. Every element names should be written within lower case l

  • Q : Long lock in the tibco iProcess

    Describe the term Long lock in the tibco iProcess in brief.

  • Q : Special set of tags in PHP Normal 0

    Normal 0 false false

  • Q : Programming analysis and design

    Illustrate the term programming analysis and design in brief.

  • Q : What is Bounded repetition Bounded

    Bounded repetition: The Repetition where statements within a loop's body are executed a fixed number of times and the number of times is established whenever the loop began. There is no control structure in Java which guarantees the bounded repetition