Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package javaapplication2;
- /**
- *
- * @author student
- */
- public class Profesor extends Persoana{
- private String materie;
- public Profesor(String materie, String nume){
- super(nume);
- this.materie = materie;
- }
- public Profesor(String materie){
- this.materie = materie;
- this.nume = "DEFAULT";
- }
- public Profesor(){
- this.materie = "haha";
- this.nume = "Default";
- }
- @Override
- public String toString() {
- return "Profesor{" + "materie=" + materie + '}';
- }
- public void preda(){
- System.out.println(this.nume);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement