• 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
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

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: 11338
177
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
Marshal
Posts: 38687
677
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!