The question goes as follows:
What happens when this servlet is compiled and deployed? (1 correct answer)
1. Compilation fails because doGet() is protected.
2. Compilation fails because doGet() does not declare a ServletException.
3. Deployment succeeds and clients are served just fine.
My answer was 2, but the answers list 3 as the correct answer. However, I've checked the API, and doGet throws ServletException, which is a checked exception and no subclass of IOException, so it should be 2, shouldn't it?
Does this servlet compile successfully? (1 correct answer)
1. Compilation succeeds.
2. There is a compilation error at line #1.
3. There is a compilation error at line #2.
4. Both lines #1 and #2 contain a compilation error.
My answer was 3, 'cause println() is a void method, but the answer listed as the correct one is 4.. That's not right, is it? IOException and ServletException are both subclasses of Exception, so Exception will catch either, no?
Anyone have any other, more reliable, mock exams? I really want to do some more mocks before taking my SCWCD, but I don't want to have to pay for them... Already did the Inquisition ones, and the ones from the book...
I agree with Nidhi on both answers and explanations.
There ar a lot of free mock exams, but the quality is not always good and not to mention about the outdated questions. The one (commercial) mock exam product that will for sure make you pass the exam is the one of Enthuware. The level of difficulty and the way questions are asked is simular to the real exam.....