Happy Codings - Programming Code Examples
Html Css Web Design Sample Codes CPlusPlus Programming Sample Codes JavaScript Programming Sample Codes C Programming Sample Codes CSharp Programming Sample Codes Java Programming Sample Codes Php Programming Sample Codes Visual Basic Programming Sample Codes


Java Programming Code Examples

Java > Learning Code Examples

Pie Maker

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
Pie Maker package com.ack.learning.exceptions; import com.ack.learning.exceptions.PieEater; import com.ack.learning.exceptions.PieException; public class PieMaker { public static void main( String[] args ) { try { PieEater pie = new PieEater(); // some processing System.out.println( pie.howManyPies() ); } catch( PieException pex ) { // catch the PieException and printout its stack trace pex.printStackTrace(); } finally { // and always print out 'no more pies', regardless of what // happens within the try block System.out.println( "no more pies" ); } } }