/* * @topic T00300 static methods and local variables * @brief Sep 2016 demo code */ package week03_01; import java.util.Scanner; public class MainApp { private static int addTwoIntegers( int left, int right ) { int temp = left + right; return temp; }//addTwoIntegers public static void main(String[] args) { int factor = 11; int value = 22; //Scanner sc = new Scanner(System.in); //System.out.print("enter a value: "); //value = sc.nextInt(); //value = value + 10; int factoredValue = addTwoIntegers( factor, value ); factoredValue = addTwoIntegers( 0, 5 ); String strMessage = "value is " + factoredValue + "\n"; printMessage( strMessage ); }//main private static void printMessage( String message ) { System.out.print( message ); }//printMessage private static void printMessage( String message, String delimiter ) { printMessage( message ); System.out.println( delimiter ); }//printMessage }//class MainApp