Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main1 {
- /**
- * @param args
- */
- public static void main(String[] args) {
- MyClass myObjectA = new MyClass(3000);
- MyClass myObjectB = new MyClass(2500);
- System.out.println(myObjectA.myInt);
- System.out.println(myObjectB.myInt);
- myObjectA.setMyLong(1000L);
- myObjectB.setMyLong(4000L);
- System.out.println(myObjectA.getMyLong());
- System.out.println(myObjectB.getMyLong());
- System.out.println(myObjectB.classVariable);
- myObjectA.classVariable = 3000;
- System.out.println(myObjectB.classVariable);
- // Proper way to set class variables.
- MyClass.classVariable = 1000;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment