HarrJ

Day 4 String variables

Aug 3rd, 2023
1,032
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. package mng2023b5;
  2.  
  3. public class Day04B {
  4.     public static void main(String[] args) {
  5.         String txtSample = "22";
  6.         String txt1, txt2, txt3;
  7.        
  8.         System.out.println("Variable value: " + txtSample);
  9.        
  10.         txt1 = "Sometimes I'm alone,";
  11.         txt2 = "Sometimes I'm not,";
  12.         txt3 = "Hello?";
  13.        
  14.         System.out.println(txt1);
  15.         System.out.println(txt2);
  16.         System.out.println(txt1);
  17.         System.out.println(txt3);
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment