Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Student {
- private String nazwisko;
- private String imie;
- private long album;
- private int rok;
- private double srednia;
- public Student(){
- nazwisko = "Kowalski";
- imie = "Jan";
- album = 2342;
- rok = 2013;
- srednia = 3.0;
- }
- public Student (String nazwisko, String imie, long album, int rok, double srednia)
- {
- this.nazwisko = nazwisko;
- this.imie = imie;
- this.album = album;
- this.rok = rok;
- this.srednia = srednia;
- }
- public void wyswietl()
- {
- System.out.printf("I %1$-20SI %2$-15S I %3$1d I %4$4d I %5$1.2f I", nazwisko, imie, album, rok, srednia);
- }
- public String toString(){
- return nazwisko+" "+imie+" "+album+" "+rok+" "+srednia;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement