Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Pocetok {
- public static void main(String[] args) {
- Student student = new Student("josif", "tepegjozov", 100, 12345);
- System.out.println(student.ime + " " + student.prezime + " " + student.godini + " " + student.broj_na_indeks);
- }
- }
- class Student {
- String ime, prezime;
- int godini, broj_na_indeks;
- Student() {} // empty consctuctor(defualt)
- Student(String _ime, String _prezime, int _godini, int _broj_na_indeks) { // parameterized constructor
- ime = _ime;
- prezime = _prezime;
- godini = _godini;
- broj_na_indeks = _broj_na_indeks;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement