Hi Ranchers,
From my understanding "Programmatically Thrown Exceptions" must be declared or catched, but why does the code as following can be compiled:
1. class B {
2. public static void main (
String[] arg)
3. {
4. Integer i=Integer.valueOf("123");
5. }
6. }
In the class "Integer", the method "valueOf" is declared as ---
public static Integer valueOf(String s)throws NumberFormatException.
why, in the caller code, can it be complied without exception thrown or captured ? Thanks.