Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Invoke {
- public static void main(String[] args) {
- int y = 5;
- int z;
- Number num = new Number();
- num.setX(y);
- z = num.getX();
- System.out.println("The integer is: " + z);
- }
- }
- class Number {
- private int x;
- public void setX(int a) {
- x = a;
- }
- public int getX() {
- return x;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement