// Basic Statements // more demonstration of statements public class statements1 { public static void main(String[] args) { // Empty: ; // Arithmetic: // Does Java let you do this? // 1+1; // Which language does? // Methods: // A METHOD is a sequence of actions that // performs a task. // - Some methods are built-in and some are // user defined. // - Some methods calculate a value and some // do not. // - Methods that calculate a value can be // combined with operators // Built-in method with no value: System.out.println(1.0/2.0); // Output: _____ // Built-in method with a return value: System.out.println( Math.random() ); // ^^^^^^^^^^^^^ // Java calls Math.random() and // replaces the code $Math.random()$ with // a value between 0 (inclusive) // and 1 (exclusive). } }