• Post Reply Bookmark Topic Watch Topic
  • New Topic

why java introduced -Xlint  RSS feed

 
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the difference between
PriorityQueue<String> pq3 = new PriorityQueue<String>();//warning
PriorityQueue pq3 = new PriorityQueue();//giving xlint warning msg when i compile

why java has introduced this ?
 
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The syntax with the < and > is generics (it's not called Xlint) and it was added in Java 5. Generics help to make your application more typesafe, and you will not need to cast as much anymore.

See also the Generics Tutorial (PDF).
 
author and jackaroo
Marshal Commander
Posts: 12156
256
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As for the '-Xlint':

-X is a flag to the compiler to say that a non-standard option is about to be invoked. Find out more about what is possible on the Sun list of non-standard options.

You can read up on what a lint tool is via Wikipedia's entry for lint

Regards, Andrew
 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for ur suggestions
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!