% Since version 1.7.1
% Demonstrate exception handling in constructors

:- eval(ex019()).

on_create_exception(L) :-
	exception(Ex),
	println([Ex]),
	% Corrective action: assign L an empty list
	L=java.util.ArrayList().

ex019() :-
	println(["==========ex019=========="]),
	on_exception(java.lang.Exception,on_create_exception(L)),
	% No constructor with two parameters as below
	L=java.util.ArrayList(2,2),
	println(["L=",L]).
