Why i get HelloWorld.java uses or overrides a deprecated API, when compiling java using cmd? -
when compiling java file helloworld.java using command prompt, why following errors:
note: helloworld.java uses or overrides deprecated api. note: recompile -xlint:deprecation details.
this hint, using function condiered "deprecated", i.e. may vanish in later versions of java (see http://docs.oracle.com/javase/6/docs/api/java/lang/deprecated.html official definition).
the concept of deprecating apis works this: in version, lets say, 1.0 api gets added. in later version (e.g. version 3.0) better apis introduced, , old api marked deprecated in order warn people using old api - in version people warning, old api not yet removed backward compatibility. later version lets 5.0 deprecated api may removed.
check out java documentation (see links below) getting more information this. there written, new methods use instead.
- java se 6 api: http://docs.oracle.com/javase/6/docs/api/
- java se 7 api: http://docs.oracle.com/javase/7/docs/api/
- java se 8 api: http://docs.oracle.com/javase/8/docs/api/
Comments
Post a Comment