Does constructor return any value in Java?

No, constructor does not return any value.

  • While declaring a constructor you will not have anything like return type.
  • In general, Constructor is implicitly called at the time of instantiation.
  • And it is not a method, its sole purpose is to initialize the instance variables.


Live Demo

public class Sample{
   public Sample(){
      System.out.println("This is a constructor");
   public static void main(String args[]){
      Sample obj = new Sample();


This is a constructor