Win a copy of Serverless Applications with Node.js this week in the NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

Error Found in Table 4.3 on Page 184 (Java OCA 8 Programmer I Study Guide)  RSS feed

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to Book, Calling An instance method or variable from Static Method is not Legal. I understood, that without the reference variable it would not be possible, but with object reference it is possible

How? column should be updated.
 
Sheriff
Posts: 11604
178
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Suresh Regmi,

First of all, a warm welcome to CodeRanch!

Suresh Regmi wrote:How? column should be updated.


I agree! Especially because on the previous page in the section Static vs. Instance this case is illustrated with an example: it's suggested to invoke new Static().third(); from the (static) main method.

So both the columns Legal? and How? should be updated to Yes and Using a reference variable respectively.

Hope it helps!
Kind regards,
Roel
 
author & internet detective
Posts: 39208
726
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suresh,
Welcome to CodeRanch!

I've noted this in the errata. I feel like this is worse than a typo/error in the book. I wanted to convey that assuming you have no reference variables, you can call a static method from an instance method but not vice versa. And that's not what the table actually conveys.
 
"I know this defies the law of gravity... but I never studied law." -B. Bunny Defiant tiny ad:
global solutions you can do in your home or backyard
https://coderanch.com/t/708587/global-solutions-home-backyard
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!