Methods

Java Documentation

Static Method: A method that can be used without calling an object

  • Static methods are invoked using the class name in place of a calling object
    • returnedValue = MyClass.myMethod(arguments);

equalsIgnoreCase(Other_String)

toLowerCase()

compareTo()

Compare strings lexographically (how far away they are from each other in the alphabet) or numerically
	
     // ** Case Matters **
     eg:
      System.out.println("Comparing \"Boo\" to \"Zot\" produces");
       System.out.println("Boo".compareTo("Zot")); // Produces -24 as B is 24 letters in front of Z in the alphabet
		
     System.out.println("Comparing \"Johnnyson\" to \"John\" produces");
      System.out.println("Johnnyson".compareTo("John")); // Productes 5 as there are 5 less letters in "John"
		
     System.out.print("Comparing \"axe\" with \"dog\" produces ");
      int i = "axe".compareTo("dog");
      System.out.println(i); // produces -3

main()

Main
  public static void main(String[] args){
	System.out.println("Hello, world");	
  }