Advertisement
Josif_tepe

Untitled

Oct 30th, 2021
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Pocetok {
  4.  
  5.  
  6.         public static void main(String[] args) {
  7.        Student student = new Student("josif", "tepegjozov", 100, 12345);
  8.             System.out.println(student.ime + " " + student.prezime  + " " + student.godini + " " + student.broj_na_indeks);
  9.  
  10.     }
  11. }
  12. class Student {
  13.     String ime, prezime;
  14.     int godini, broj_na_indeks;
  15.     Student() {} // empty consctuctor(defualt)
  16.  
  17.     Student(String _ime, String _prezime, int _godini, int _broj_na_indeks) { // parameterized constructor
  18.         ime = _ime;
  19.         prezime = _prezime;
  20.         godini = _godini;
  21.         broj_na_indeks = _broj_na_indeks;
  22.     }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement