Functional Methods

Run Settings
LanguageJava
Language Version
Run Command
class Main { public static void main(String[] args){ Fway(); Sway(); System.out.println("The method multiplies any number between 1-10."); System.out.println(Tway((int)Math.ceil(Math.random()*5))); } public static void Fway(){ System.out.println("The method states a fact in my opinion"); System.out.println("Dogs are the best!"); System.out.println("----------------------"); } public static void Sway(){ int base = 8; int height = 24; int TotalArea = (base * height)/2; System.out.println("The method calculates the area of the triangle by the formula"); System.out.println("The area has a base "+base+" and the height "+height+", is equal to "+TotalArea+"cm^2"); System.out.println("----------------------"); } public static int Tway(int rnumber){ return (rnumber * 5); } }
Editor Settings
Theme
Key bindings
Full width
Lines