954,536 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

uses or overrides a deprecated API. [javac] error

hi need some help.

I am getting an error with the code below, the error is uses or overrides a deprecated API. [javac]. Which is not really an error but what other way should i code this "Vector dataHeaderDisplay = new Vector(finalData);"

Please help.

if(materialType.equals("trim")){
Vector dataHeaderDisplay = new Vector (finalData());

}


else
{
Vector dataHeaderDisplay = new Vector(jointData);
// Vector dataHeaderDisplay = new Vector(jointData);
System.out.println("----------------------------------------print this-----------------");
}



System.out.println("----------------------------------------Print the else statement-----------------");


Vector dataHeaderDisplay = new Vector(termSizeCollection);

sampitt
Newbie Poster
2 posts since Oct 2005
Reputation Points: 10
Solved Threads: 0
 

1) don't use Vector. Unless you KNOW you need it specifically there are better alternatives like ArrayList.
2) that line shouldn't throw a deprecation warning as you're not using any deprecated methods.
What you should get is a warning about unsafe operations as you're not using a Vector with a specific type of entry set through generics.
So your deprecation warning is something else...

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You