Avoid Conflict when Using Dates
Java Interview Special Tips
(Continued from previous question...)
15. Avoid Conflict when Using Dates
Suppose you have imported both java.util and java.sql packages into your program and you wish to use a Date class.
This would create a conflict because both the packages have a Date class. To overcome this, give a fully qualified name when using the Date class.
For example:
java.util.Date d= new java.util.Date();
(Continued on next question...)
Other Interview Questions
|