Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyClass {
- private int value = 0;
- public void setValue(int zmienna) {
- value = zmienna;
- }
- public int getValue() {
- return value;
- }
- }
- class main { -- Twój program czyli on create w androidzie itd.
- MyClass mojaKlasa = new MyClass();
- MyClass mojaKlasa2 = new MyClass();
- mojaKlasa.setValue(2);
- System.out.println(mojaKlasa.getValue.tostring); -- to zwróci 2
- System.out.println(mojaKlasa2.getValue.tostring); -- to zwróci 0
- }
- -- Bo posiadasz 2 różne obiekty
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement