• 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Mock Question from KS && BB..errata?

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am sure Kathy and Bert would love to kill me for posting so many code excerpts from their book.:-(.Sorry, I am a confused soul.

The below code will obviously fail compilation because of the
error at line 16:



No problems till here.

However, the explanation given in the Reference/Hint section(that comes with the questions in mock exam)is :


...If line 16 was removed, the code will compile and the correct answer would be "Start Hello World File Not Found".



When I tried compiling this code after removing line 16,the code still did not compile and gave :


Please confirm whether there is a wrong explanation given in KS&BB,
or if there is a gap in my understanding.
regards,
Prashant
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
try must be associated with finally, or catch.
try block following must be catch or finally. But in your code, there is a statement between the try block and catch block.please check this.
in your compile time error shows that, it is not legal, to throw IOException, without using ioexception statements in your coding. if any mistakes in my view pls reply.

Regards,
Muthukumar.C
 
Thank you my well lotioned goddess! Here, have my favorite tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic