The Artima Developer Community
Sponsored Link

Java Answers Forum
Class Collission

2 replies on 1 page. Most recent reply: Aug 8, 2002 12:01 AM by Bin Zhang

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
ven

Posts: 2
Nickname: nandi
Registered: Aug, 2002

Class Collission Posted: Aug 6, 2002 9:42 AM
Reply to this message Reply
Advertisement
I want to import two classes with same name, residing in two different packages.

ex :
in main class
import com.test1.class1;
import com.test2.class1;

If any one helps me that will be greateful.

with regards


Matt Gerrans

Posts: 1153
Nickname: matt
Registered: Feb, 2002

Re: Class Collission Posted: Aug 6, 2002 11:51 AM
Reply to this message Reply
You can import one and fully reference the other, or just fully reference both in your code (probably the latter will result in more readable and maintainable code). For example:
com.test1.class1 ob = new com.test1.class1();
com.test2.class1 ob = new com.test2.class1();

Bin Zhang

Posts: 4
Nickname: matrix
Registered: Aug, 2002

Re: Class Collission Posted: Aug 8, 2002 12:01 AM
Reply to this message Reply
I agree with the one upstairs.

Flat View: This topic has 2 replies on 1 page
Topic: sockets Previous Topic   Next Topic Topic: Hey guys I need some help

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use