11
May
Posted by liubin as Ruby
| 1,262 Views
- class A
- end
-
- a = A.new
-
- puts a.class
-
- class Object
- remove_const 'A'
- end
-
- puts a.class
-
- begin
- b = A.new
- rescue NameError
- puts 'Not Found Class A'
- end
执行结果:
A
A
Not Found Class A
Related posts for the current post: