- 1
Help me to fix this error
import java.util.Links; public class Links { public static void main(String[] args) { LinkedList Links = new LinkedList; Links.add(1); Links.add(2); Links.add(3); Links.add(4); Links.add(5); System.out.println(Links); } }
2 Respostas
+ 5
Incorrect or invalid declaration of LinkedList..
Here you go
import java.util.*;
public class Links {
public static void main(String[] args) {
LinkedList <Integer> Links = new LinkedList<>();
Links.add(1);
Links.add(2);
Links.add(3);
Links.add(4);
Links.add(5);
System.out.println(Links);
}
}
+ 2
Please always tag the language you're asking about and use meaningful titles.
Don't expect people to put effort into helping you if you're not even willing to put any effort into asking your question.
https://www.sololearn.com/Content-Creation-Guidelines?
https://code.sololearn.com/Wv5gTHy1N6Ji/?ref=app
https://www.sololearn.com/discuss/1316935/?ref=app
https://code.sololearn.com/W3uiji9X28C1/?ref=app
https://www.sololearn.com/discuss/333866/?ref=app