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 : Program is prone to deadlock when

      Give a brief introduction about the operation of your program and show that you understand the idea behind threads and mutual exclusion variable. Why do we need to use mutual exclusion to control the access of the three global variables? What is the potential p

  • Q : Define Divide and conquer Divide and

    Divide and conquer: An approach to trouble solving which attempts to decrease an overall single big trouble into multiple simpler troubles.

  • Q : Define the term Manifest file Define

    Define the term Manifest file: It is a file which is held in a Java Archive (JAR) file, explaining the contents of the archive.

  • Q : Explain Program counter Program counter

    Program counter: A program counter is an integral portion of a computer's Central Processing Unit. It includes a reference to the memory address of the subsequent instruction to be fetched, ready to be executed throughout the next fetch-execute cycle.

  • Q : Describe Layout manager Layout manager

    Layout manager: The object responsible for sharing the accessible space between multiple components in a graphical container.

  • Q : What is Native method Native method :

    Native method: In native method, the method is written in a language other than Java, however accessible to a Java program. Native methods are far away from the scope of this definition.

  • Q : What is XLink What is XLink? Answer: It

    What is XLink? Answer: It is a part of the XLL specification which is concerned along with specifying links among documents.

  • Q : Explain Structured programming

    Structured programming: It is a style of programming generally related with languages like FORTRAN, C, Pascal and so forth. Employing structured programming methods, a problem is frequently resolved employing a divide and conquer approach like stepwis

  • Q : Explain Assignment operator Assignment

    Assignment operator: The operator (=) employed to store the value of an expression into the variable, for example: Variable = expression; The right-hand

©TutorsGlobe All rights reserved 2022-2023.