why we import both packages java.awt.*; and java.awt.event.*;
as java.awt.*; can import all classes na. then what is the
need of importing java.awt.event.*; ?

Answer Posted / shiva

writing java.awt.*; can import only the classes inside it but not its sub packages. so we need to write the sub package also.

Is This Answer Correct ?    20 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does collectionutils isempty check for null?

803


Does importing a package imports its sub-packages as well in java?

545


Can an interface extend another interface?

588


How many bytes is a url?

556


Can we sort set in java?

530






Why string is called as immutable?

518


What is the exact difference in between unicast and multicast object? Where we will use?

552


What is the final variable?

572


Which programming language is best in future?

516


What is the main advantage of passing argument by reference?

495


What is t in generics in java?

551


What is parsing in grammar?

547


What causes memory leaks in java?

479


What is the use of using enum to declare a constant?

548


What is the size of an array?

545