Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package uczen;
- public class Uczen {
- private int ocena1;
- private int ocena2;
- private int ocena3;
- public void ustawOceny(int ocena1,int ocena2,int ocena3)
- {
- this.ocena1=ocena1;
- this.ocena2=ocena2;
- this.ocena3=ocena3;
- if(ocena1<1||ocena2<1||ocena3<1||ocena1>6||ocena2>6||ocena3>6) throw new Wyjatek();
- }
- public Uczen(int ocena1,int ocena2,int ocena3) {
- this.ustawOceny(ocena1, ocena2, ocena3);
- }
- public static void main(String[] args) {
- try
- {
- Uczen u=new Uczen(1,2,3);
- }
- catch(Wyjatek w)
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement