public class TestApp{ public static void main(String[] args){ try{ String myname = null; if(myname.length()>2) System.out.print(“1”); }catch(NullPointerException e){ System.out.print(“2”); } } } 上述程序运行后的输出是哪项?()
- A 1
- B 12
- C 21
- D 2
public class TestApp{ public static void main(String[] args){ try{ String myname = null; if(myname.length()>2) System.out.print(“1”); }catch(NullPointerException e){ System.out.print(“2”); } } } 上述程序运行后的输出是哪项?()
因为主方法的大括号在最后