Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

page is instanceof JspPage

 
Himai Minh
Ranch Hand
Posts: 1361
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to Niko's mock exam, this code return true.


But page is an instanceof an Object. Why this is still true?
Thanks.
 
Paul Clapham
Sheriff
Posts: 21567
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Himai Minh wrote:But page is an instanceof an Object.


Why is that a relevant statement? Every Java object is an instance of Object.
 
Himai Minh
Ranch Hand
Posts: 1361
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Paul,
But according to this web site: http://beginnersbook.com/2013/11/jsp-implicit-objects/ and p. 298 of Head First book
page is an instance of Object.
 
Paul Clapham
Sheriff
Posts: 21567
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay. And is JspPage a class? Because that's what the table you linked to is talking about. My 30 seconds of web searching tends to suggest to me that it's an interface.
 
Himai Minh
Ranch Hand
Posts: 1361
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I know why page is an Object and also an instance of JspPage.
On p. 297 of Head First,
A JSP is translated into:


page is an instance of an Object of this BasicCounter_jsp. BasicCounter_jsp is an instance of HttpJspBase. HttpJspBase implements HttpJspPage, which implements JspPage.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic