I am new to java so maybe this is very trivial question.
But I just noticed that when i declared
List myList = new ArrayList();
Eclipse IDE gave me bunch of options for "List" error.
Mainly.. the top 2 one got me curious.
What is the difference if I use java.awt vs java.utils ??
awt.List is a List component used in GUI where as java.util.List is an interface for the lists data structure. Follow this answer to receive notifications.
import java. awt. Graphics means that the Graphics class in the java. awt package is made known to the current class.
The java. awt package provides classes for AWT API such as TextField, Label, TextArea, RadioButton, CheckBox, Choice, List etc. The AWT tutorial will help the user to understand Java GUI programming in simple and easy steps.
java.awt.List
is List component (like drop down list), it not a collection/datastructure.
What is the difference if I use java.awt vs java.utils ??
You can't use List/Collection specific methods like iterator.
awt.List is a List component used in GUI where as java.util.List is an interface for the lists data structure
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With