I am completely lost right now. I don't get what the questions are trying to say and I want to know if someone can give me pseducode or just a small example on how to start them off because like I said I'm lost. I'm not trying to get answers or someone to do the work for me. I just need a general idea.

  1. (Order of catch Blocks) Write a program that shows that the order of catch blocks is important. If you try to catch a superclass exception type before a subclass type, the compiler should generate errors.

  2. (Constructor Failure) Write a program that shows a constructor passing information about constructor failure to an exception handler. Define class SomeClass, which throws an Exception in the constructor. Your program should try to create an object of type SomeClass and catch the exception that's thrown from the constructor.

Hi ZK
It's hard to answer your post because we don't understand what your real problem is. Both tasks are really small and simple - maybe you are looking for some complexity or difficulty that's not actually there?

Eg. look at 2 again: "Define class SomeClass, which throws an Exception in the constructor. Your program should try to create an object of type SomeClass and catch the exception that's thrown from the constructor."
If you can explain exactly what's stopping you from doing that then hopefully someone here can fix that for you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.