-
-
Save uncoded-ro/ce28a5011ded3a5afc2559e0431ba1ab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Carte { | |
String titlu; | |
String autor; | |
Carte() { | |
titlu = " "; | |
autor = " "; | |
} | |
Carte(String titlu, String autor) { | |
this.titlu = titlu; | |
this.autor = autor; | |
} | |
void fisaCarte() { | |
System.out.println("Titlu: " + titlu); | |
System.out.println("Autor: " + autor); | |
} | |
void fisaCarte(int id) { | |
System.out.println("Id: " + id); | |
System.out.println("Titlu: " + titlu); | |
System.out.println("Autor: " + autor); | |
} | |
public static void main(String[] args) { | |
Carte c1 = new Carte("Morometii", "Marin Preda"); | |
Carte c2 = new Carte("Fratii Jderi", "Mihail Sadoveanu"); | |
c1.fisaCarte(); | |
c1.fisaCarte(1); | |
c2.fisaCarte(2); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment