This problem may occur when you use JDK or above when compiling Java source files with unchecked or insecure operations. (Unchecked or insecure operations are used. Use-xlint: unchecked to re-compile .) The reason is that the creation of collection classes in jdk1.5 is different from that in jdk1.4, mainly because the generic type is added in jdk1.5, that is, the data in the set can be checked. Before JDK 1.5, if no parameter type is specified, the JDK compiler reports the unchecked warning because it cannot check whether the given parameter meets the requirements, which does not affect the running. Follow the prompts to cancel the warning by specifying the parameter. You can also specify a type parameter for the parameter. List temp = new arraylist (); temp. add ("1"); temp. add ("2"); change to list <string> temp = new arraylist <string> (); temp. add ("1"); temp. add ("2 ");
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service