Pregunta de entrevista de Tudip Technologies

Diff between tree&graph,Hash map&Hash set? what is constructor&constructor can through exception ?

Respuesta de la entrevista

Anónimo

11 de oct de 2019

The man purpose of cocnstructor is to perform initializaion f an object but not to creat object. If the constructor doesn't receive valid input, or can't construct the object in a valid manner, it has no other option but to throw an exception and alert its caller. ... Constructors are nothing more than special methods, and can throw exceptions like any other method.