An arraylist always comes along with class | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

An arraylist always comes along with class

class Points { int x,y; } void setup () { size(700,700); background(255); } ArrayList<Points> points = new ArrayList (); void draw (){ if ( points.size()==0) return; Points p = points.get(0); for (int i = 0 ; i< points.size(); i ++) { Points p3 = points.get(i); connect(p,p3); p=p3; } }` //THE ABOVE CODE LOOKS FINE UNTIL I REPLACE THE EIGHTH LINE BY : ArrayList points = new ArrayList (); The problem is that I can't access to the arraylist The error is like "Type mismatch , "Java.lang.Object " does not macth with "mypdefile" Clear explanations or a particular example are preferred over abstract ones Thank you in advance

12th Apr 2017, 8:50 AM
thành long nguyễn
thành long nguyễn - avatar
1 Respuesta
0
what is mypdefile. Question is not properly explained.
12th Apr 2017, 3:04 PM
Anand Barnwal
Anand Barnwal - avatar