• 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

Warning while compiling

 
Greenhorn
Posts: 17
Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all, i have a doubt..

Can we a call a compilation of File.java successful if there is a warning? ....will the "File.class" be created?.....or do we have to consider that the compilation is not successful ...
i have this NOTE while compiling..
Note:File.java uses unchecked or unsafe operation.
Note:Recomplie with -Xlint:unchecked for details.

when i recompiled it using -Xlint i had a warning....so can we consider that the File.java complied?
 
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Asher Basheer wrote:Hi all, i have a doubt..

Can we a call a compilation of File.java successful if there is a warning? ....will the "File.class" be created?.....or do we have to consider that the compilation is not successful ...
i have this NOTE while compiling..
Note:File.java uses unchecked or unsafe operation.
Note:Recomplie with -Xlint:unchecked for details.

when i recompiled it using -Xlint i had a warning....so can we consider that the File.java complied?




Yes, the file File.class is created.

For the OCPJP exam, you must know the difference between compilation warning and compilation error.

Compilation warning will let you know if your code does not follow best practices, i.e. using unchecked or unsafe operation.

Compilation error means part of your code is illegal, due to incorrect syntax, wrong class type, etc.

 
reply
    Bookmark Topic Watch Topic
  • New Topic