• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

constructor doubt

 
Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


In K&B book, its written that this kind of code gives an exception"StackOverFlowError". But I got compiler error"Recursive constructor invocation".

Can anyone explain?
 
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
nice point brought up dolly..it gives compilation error !!perhaps there might be something regarding this in K&B errata..
[ July 30, 2007: Message edited by: Priyam Srivastava ]
 
Ranch Hand
Posts: 1274
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy ranchers,

I'm quite sure the example was more than this:


Can you provide the page number, Dolly?


Yours,
Bu.
 
dolly shah
Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The example is exactly like this on page no:139

 
Burkhard Hassel
Ranch Hand
Posts: 1274
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy, ranchers,

Dolly, you're right.

Direct after the example, K&B says:


Your compiler may not actually catch the problem (it varies depending on your
compiler, but most won't catch the problem).



I compiled with version 1.5.0. It gave the error message Dolly provided.
Since this is the compiler that should be used for Java 5, perhaps an additional note should be provided in the next issue of the book.

The page is not listed in the errata page.

I'll send Bert (Bates) an e-mail.



Thanks,
Bu.
 
Anderson gave himself the promotion. So I gave myself this tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic