Constructor in java!!

Discussion in 'Bukkit Discussion' started by slaviagomes, May 29, 2020.

Thread Status:
Not open for further replies.
  1. Offline

    slaviagomes

    I am new to java. I was learning constructors in java from the blog below,


    Understood the concept quite well. One question that I have here in this topic is, can we create/initiate variables without constructors? and can we add arguments directly when the class is created, like for example

    Cars car = new Cars("Audi");

    Guide me if i'm wrong!!
    SHAREit Appvn
     
    Last edited: May 30, 2020
  2. Offline

    timtower Moderator Moderator

    Chance with that is that you forget them though.
    That is the entire point of the constructor.
     
Thread Status:
Not open for further replies.

Share This Page