/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package hello; /** * * @author Student */ public class BasicDemoException { public static void main(String[] args){ int value = 5; String xval = "a"; try{ for (int current =1; current<=10; current++){ //value=value/0; value = value + Integer.parseInt(xval); } } catch(NumberFormatException e){ System.out.println("attempt to add the value to an xval"); } finally{ System.out.println("Value = "+ value); } } }