Random (Date Format etc)

see (letter codes): https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/time/format/DateTimeFormatter.html

m = minute

M = month eg 9 or 12 etc

MM = 09, 10 ,01

MMM = jan, feb …

MMMM = January , April …

e.g.

var formatter = DateTimeFormatter.ofPattern(“d MMMM y”);

Would result in format like so:

31 August 2021

(note y defaults to 4y , d to 1 or 2 )

 

StringBuilder

review append ( it adds to end )

return new StringBuilder(fullPhoneNumber).append(“xxxx”, 8, 12).toString();

substring() is only method that returns a String

 

Remember static method of Interface

interface Pow{
    static void wow(){
        System.out.println("In Pow.wow");    
    }
}

 

can only be accessed by Pow.wow, not by someInstance.wow()

( static methods on interface are not inherited like they are in classes )