🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.java.programmer
Article #297

Re: Bizarre import weirdness

#297
From: Jon Skeet
Date: Tue, 04 Dec 2001 22:56
44 lines
2241 bytes
Ron Albright <moron(at)pobox.com> <Ron Albright <moron(at)pobox.com>> 
wrote:

> >Because otherwise the compiler has no idea what you mean by 
> >"PersistentRdbmsObject". There could be any number of classes with that 
> >name in various packages.
> 
> So you're implying the 'import <package>.*' statement does
> nothing? 

I'm saying that you there is no difference in the compiled class file 
between:

import java.util.*;
public class Test
{
    Vector v = new Vector();
}

and

public class Test
{
    java.util.Vector v = new java.util.Vector();
}

> If you have the following 2 imports the compiler
> gives an ambiguous reference error if a 'Date' object is
> declared without specifying the package.
> 
> import java.sql.*;
> import java.util.*;

I don't see the relevance of this. You just need to tell the compiler 
which to use in preference, eg:

import java.sql.*;
import java.util.*;
import java.sql.Date;

-- 
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Technical Details
Message-ID: <MPG.167764de8d36fdc398a67c@mrmog.peramon.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!193.174.75.178!news-fra1.dfn.de!news-koe1.dfn.de!lnewspeer00.lnd.ops.eu.uu.net!lnewsifeed00.lnd.ops.eu.uu.net!lnewsifeed01.lnd.ops.eu.uu.net!lnewspost00.lnd.ops.eu.uu.net!emea.uu.net!not-for-mail
References: <612q0uggd5qbghbdj3dm16vet63el85a34@4ax.com> <MPG.1677224fb3f43e5198a676@mrmog.peramon.com> <2fbq0uc3fvvu49ro53j1pq2mip7nff83bg@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fa3e3,b03b9f2c50f270a6
X-Google-Attributes: gidfa3e3,public
X-Google-Thread: 10a146,b03b9f2c50f270a6
X-Google-Attributes: gid10a146,public
X-Google-ArrivalTime: 2001-12-04 14:56:26 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!193.174.75.178!news-fra1.dfn.de!news-koe1.dfn.de!lnewspeer00.lnd.ops.eu.uu.net!lnewsifeed00.lnd.ops.eu.uu.net!lnewsifeed01.lnd.ops.eu.uu.net!lnewspost00.lnd.ops.eu.uu.net!emea.uu.net!not-for-mail
From: Jon Skeet <skeet@pobox.com>
Newsgroups: comp.lang.java.programmer,borland.public.jbuilder.ide
Subject: Re: Bizarre import weirdness
Date: Tue, 4 Dec 2001 22:56:01 -0000
Message-ID: <MPG.167764de8d36fdc398a67c@mrmog.peramon.com>
References: <612q0uggd5qbghbdj3dm16vet63el85a34@4ax.com> <MPG.1677224fb3f43e5198a676@mrmog.peramon.com> <2fbq0uc3fvvu49ro53j1pq2mip7nff83bg@4ax.com>
Organization: Peramon Technology Ltd.
X-Newsreader: MicroPlanet Gravity v2.30
Lines: 44
NNTP-Posting-Host: fw1.peramon.com
X-Trace: 1007506563 reading.news.pipex.net 8514 193.132.195.113
X-Complaints-To: abuse@uk.uu.net