Hi
The first answer choice is: "It is of type java.io.OutputStream.". It is wrong according to the Enthuware software.
However, just by looking inside the java code, we can see that a PrintWriter IS-A OutputStream. That also means instanceof operator would return true for example.
What's the catch here?
Thanks
About Question enthuware.ocpjp.ii.v11.2.3346 :
Moderator: admin
-
- Posts: 10
- Joined: Tue Jul 09, 2019 8:33 am
- Contact:
-
- Site Admin
- Posts: 10053
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.ii.v11.2.3346 :
Yes, PrintStream is-a OutputStream but since the question is about the type the variable out, this option should not be selected. By this logic, if there were an option saying it is of type Object, then that would be correct as well. Also, the is-a test is to check the type of an object, not of a variable.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 49 guests