Advertisement
HarrJ

B8 Day 15 Method 1

Sep 27th, 2022
1,094
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1. package mattroseb8wk3;
  2.  
  3. public class Day15A {
  4.     public String txt1 = "shenanigans";
  5.    
  6.     public static void main(String[] args) {
  7.         Day15A callMe1 = new Day15A();
  8.         Day15A callMe2 = new Day15A();
  9.         callMe1.method1();
  10.         callMe1.method1();
  11.        
  12.         callMe2.txt1 = "Absolute";
  13.         System.out.println(callMe1.txt1);
  14.         System.out.println(callMe2.txt1);
  15.        
  16.         method2();
  17.         method2();
  18.     }
  19.    
  20.     public void method1() {
  21.         System.out.println("I am called from method1");
  22.     }
  23.    
  24.     public static void method2() {
  25.         System.out.println("Greetings from static method2");
  26.     }
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement