Today we practice with DrJava's Interactions Panel: 

Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop
> "a" + "b"
"ab"
> "1" + "2"
"12"
> "1" + 2
"12"
> "abc"
"abc"
> "abc".length()
3
> "whatever".substring(1, 4)
"hat"
> "whatever".substring(4)
"ever"
> "whatever".substring(2, 5)
"ate"
> "whatever".charAt(2)
'a'
> "a"
"a"
> 'a'
'a'
> '1' 
'1'
> "1".length()
1
> '1'.length()
Static Error: No method in char has name 'length'
> 2
2
> 2L
2
> Integer.MAX_VALUE
2147483647
> Integer.MAX_VALUE + 1
-2147483648
> Long.MAX_VALUE
9223372036854775807
> Long.MAX_VALUE + 1
-9223372036854775808
> 'a' + 'b'
195
> 'a' + 0
97
> '0'
'0'
> ' ' + 0
32
> '{' + 0
123
> '}' + 0
125
> 'b' + 0
98
> 'c' + 0
99
> '0' + 3 == '3'
true
> '0' + 3
51
> '3' + 0
51


--

public class Lab05 { // example 
  public static void main(String[] args) {
    // 27. 'a' – 'b' 
    System.out.println("27. 'a' - 'b' evaluates to " + ('a' - 'b') + " expected: -1");     
    // 'a' - 'b' is in fact 97 - 98 
    
    // 30. false || ! true && false 
    System.out.print( "30. false || ! true && false evaluates to "); 
    System.out.print( false || ! true && false );
    //                false ||  false && false  
    //                false ||  false 
    //                false 
    System.out.println( " expected: false ");
    
  }
}

--

Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop\whatever
> "1" + '2' + '3'
"123"
> "1" + ('2' + '3')
"1101"


--

public class Lab04 {
  public static void main(String[] args) {
    // 36. Simplify   !a == true 
    //  a      !a == true     !a 
    // ----------------------------
    // true    false          false 
    // false   true           true 
    boolean a = true;
    System.out.println( (!a == true) + " is the same as " + (!a) );
    a = false;
    System.out.println( (!a == true) + " is the same as " + (!a) );
  }
}

--

Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop\whatever
> "tomato" == "tomato"
false


--

public class Disturbing {
  public static void main(String[] args) {
    System.out.println( "tomato" == "tomato" ); // expected: false   
  }
}

--

Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop\whatever
> run Disturbing
true
> "tomato" == "tomato"
false


--