/* Author : Michael Robinson Program : finalStatic.java Purpose : To present the final data type once they are declared and a value is assigned its value can not be changed Updated : May 1, 2099 */ public class finalStatic { public static final double MONTHLY_RENT = 950; public static final Integer YEARS_LEASED = 30; public static void changeLeaseTime( int x ) { try { YEARS_LEASED = YEARS_LEASED * 1; } catch( Exception e ) { System.out.println( "YEARS_LEASED is a final variable and " + "can NOT be changed" ); } }//end public static void changeLeaseTime( int x ) public static void main( String arg[] ) { System.out.printf( "Montlhy Rent %.2f\n", MONTHLY_RENT ); System.out.printf( "Years Leased %d\n", YEARS_LEASED ); System.out.printf( "Total Rent Income : %.2f \n", ( MONTHLY_RENT * YEARS_LEASED * 12 ) ); changeLeaseTime( YEARS_LEASED ); }//end public static void main( String arg[] ) }//end public class finalStatic