class Masina {
private String nume;
private int cod;
public Masina() {
this("Arnie", 0);
System.out.println("Primul constructor ruleaza!");
}
public Masina(String nume) {
this(nume, 0);
System.out.println("Al doilea constructor ruleaza");
//Nu mai este nevoie de următoarea linie, deoarece folosim celălalt constructor de mai sus.
//this.nume = nume;
}
public Masina(String nume, int cod) {
System.out.println("Al treilea constructor ruleaza");
this.nume = nume;
this.cod = cod;
}
}
public class App {
public static void main(String[] args) {
Masina masina1 = new Masina();
Masina masina2 = new Masina("BMW");
Masina masina3 = new Masina("Porche", 6);
}
}
Output: Al treilea constructor ruleaza
Primul constructor ruleaza!
Al treilea constructor ruleaza
Al doilea constructor ruleaza
Al treilea constructor ruleaza
Greate post. Keep posting such kind of info on your blog.
Im really impressed by it.
Hello there, You’ve done a great job. I will definitely digg
it and individually suggest to my friends. I’m sure they
will be benefited from this site.
http://onlineapotheke.tech/# versandapotheke
Hello there! This is my first visit to your blog! We are a team of volunteers
and starting a new project in a community in the same niche.
Your blog provided us beneficial information to work on. You have done a outstanding job!
Hello there! I could have sworn I’ve visited this web site before but after looking at
many of the posts I realized it’s new to me. Nonetheless, I’m
definitely pleased I found it and I’ll be bookmarking it and checking
back often!
Hi to every body, it’s my first pay a visit of this blog; this blog consists of awesome and truly good information in favor of readers.
Tremendous things here. I’m very glad to see your article.
Thank you a lot and I am taking a look ahead to touch you.
Will you please drop me a e-mail?
Yes! Finally someone writes about Understanding male pattern baldness.
farmacie online autorizzate elenco acquisto farmaci con ricetta farmaci senza ricetta elenco
http://farmaciaonline.men/# farmacia online
This post offers clear idea for the new viewers of blogging, that in fact how to do blogging.