1. javac-xlint:unchecked Mymath.java Check for unsafe operations
/***************************************************/
MYMATH.JAVA:29: Warning: [unchecked] a call to add (E) that is a member of the original type ArrayList is not checked
Array.add ("1");
^
where e is the type variable:
E extends the object declared in class ArrayList
MYMATH.JAVA:30: Warning: [unchecked] a call to add (E) that is a member of the original type ArrayList is not checked
Array.add ("2");
^
where e is the type variable:
E extends the object declared in class ArrayList
MYMATH.JAVA:31: Warning: [unchecked] a call to add (E) that is a member of the original type ArrayList is not checked
Array.add ("3");
^
where e is the type variable:
E extends the object declared in class ArrayList
MYMATH.JAVA:32: Warning: [unchecked] a call to add (E) that is a member of the original type ArrayList is not checked
Array.add ("4");
^
where e is the type variable:
E extends the object declared in class ArrayList
MYMATH.JAVA:33: Warning: [unchecked] a call to add (E) that is a member of the original type ArrayList is not checked
Array.add ("5");
^
where e is the type variable:
E extends the object declared in class ArrayList
MYMATH.JAVA:34: Warning: [unchecked] a call to add (E) that is a member of the original type ArrayList is not checked
Array.add ("6");
^
where e is the type variable:
E extends the object declared in class ArrayList
MYMATH.JAVA:35: Warning: [unchecked] a call to add (E) that is a member of the original type ArrayList is not checked
Array.add ("7");
^
where e is the type variable:
E extends the object declared in class ArrayList
MYMATH.JAVA:37: Warning: [unchecked] a call to add (E) that is a member of the original type ArrayList is not checked
Array.add (array);
^
where e is the type variable:
E extends the object declared in class ArrayList
mymath.java:68: Warning: [unchecked] a call to set (Int,e) that is a member of the original type ArrayList has not been checked
Array.set (3, "hahah");
^
where e is the type variable:
E extends the object declared in class ArrayList
MYMATH.JAVA:72: Warning: [Unchecked] call to add (Int,e) as a member of the original type ArrayList not checked
Array.add (5, "5a");
^
where e is the type variable:
E extends the object declared in class ArrayList
mymath.java:87: Warning: [unchecked] a call to add (E) that is a member of the original type ArrayList is not checked
List.add ("1");
^
where e is the type variable:
E extends the object declared in class ArrayList
mymath.java:88: Warning: [unchecked] a call to add (E) that is a member of the original type ArrayList is not checked
List.add ("2");
^
where e is the type variable:
E extends the object declared in class ArrayList
mymath.java:91: Warning: [unchecked] call to AddAll (int,collection<? extends E>) as a member of the original type ArrayList not checked
Array.addall (1,list);
^
where e is the type variable:
E extends the object declared in class ArrayList
MYMATH.JAVA:99: Warning: [unchecked] a call to Retainall (collection<?>) that is a member of the original type ArrayList has not been checked
Array.retainall (list);
^
14 warnings
Bogon:javacode zyyt$ Javac Mymath.java
Mymath.java:7: Error: Requires class, interface, or enum
@SuppressWarnings ("unchecked"); the solution given
/***************************************************/
That's all you have to solve.
class preceded by @suppresswarnings ("unchecked")
@SuppressWarnings ("Unchecked")
public class mymath{
}
An unchecked or unsafe operation is used in Java