MethodDeclaration

Run Settings
LanguageJava
Language Version
Run Command
public class MethodDeclaration { public static void main(String[] args) { MethodDeclaration md = new MethodDeclaration(); md.talk(); int value = 150; int sameValue = md.getInt(value); System.out.println(sameValue); System.out.println(md.sum(1,2,4.5)); int num = md.randomNumber(); System.out.println(num); double piValue = md.getPi(); System.out.println(piValue); char[] theAlphabetArray = md.getAlphabetArray(); System.out.println(theAlphabetArray); } public void talk() { System.out.println("Inside of the talk method"); } public int getInt(int input){ return input; } public int randomNumber() { int result = (int) (Math.random() * 50) + 1; return result; } public double sum(int x, int y, double z){ return x + y + z; } public double getPi() { double theValue = Math.PI; return theValue; } public char[] getAlphabetArray() { char[] theAlphabet = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' }; System.out.println(theAlphabet); return theAlphabet; } }
Editor Settings
Theme
Key bindings
Full width
Lines