Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package mng2023b5;
- public class Day11C {
- public static void main(String[] args) {
- Day11B callBFile1 = new Day11B();
- Day11B callBFile2 = new Day11B();
- System.out.println(callBFile1.txtExtrovert);
- callBFile1.wallFlower();
- System.out.println("\n-----(1)-----\n");
- callBFile2.txtExtrovert = "Nasa labas na ako";
- System.out.println("BFile2 extrovert value: " + callBFile2.txtExtrovert);
- System.out.println("\n-----(2)-----\n");
- Day11B.txtTheOne = "There are multiple instances that call me";
- System.out.println("Using callBFile1");
- callBFile1.wallFlower();
- System.out.println("\n-----(3)-----\n");
- System.out.println("Using callBFile2");
- callBFile2.wallFlower();
- }
- }
- //---------------------------
- public class Day11B {
- public String txtExtrovert = "I'm a public variable";
- private String txtIntrovert = "I'm a very private variable";
- public static String txtTheOne = "I'm the only one";
- private static String txtTheOtherOne = "I'm the hiding one";
- public void wallFlower(){
- System.out.println("wallFlower method:");
- System.out.println(txtExtrovert);
- System.out.println(txtTheOne);
- System.out.println("And the +1:");
- System.out.println(txtIntrovert);
- System.out.println(txtTheOtherOne);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment