Path: csiph.com!aioe.org!.POSTED!not-for-mail From: =?UTF-8?Q?Arne_Vajh=c3=b8j?= Newsgroups: comp.lang.java.programmer Subject: Re: package statement in standalone Java class Date: Sat, 7 Apr 2018 16:32:55 -0400 Organization: Aioe.org NNTP Server Lines: 29 Message-ID: References: <57ad7674-0fca-4169-81a8-e98b5b084567@googlegroups.com> NNTP-Posting-Host: PBuS014lhzVyHjLbXmo/ZQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 X-Notice: Filtered by postfilter v. 0.8.3 Content-Language: en-US Xref: csiph.com comp.lang.java.programmer:38236 On 4/7/2018 4:28 PM, Martin Gregorie wrote: > On Sat, 07 Apr 2018 15:58:39 -0400, Arne Vajhøj wrote: >> On 4/7/2018 2:23 PM, Martin Gregorie wrote: >>> On Sat, 07 Apr 2018 08:25:47 -0700, Morten W. Petersen wrote: >>>> I'm new to Java, and having Java, Maven and different libraries to >>>> consider if I get an error seems too complex to debug. >> >>> To a first approximation you should treat Java's 'import' statements as >>> the equivalent to C's #include preprocessor statements. Just >>> as as you can't compile a C program that does anything much without >>> using #includes and linking it with the relevant libraries, the only >>> Java program you can compile without imports is one that only uses >>> external classes from the java.lang group. >> >> Strictly speaking you can use any external class without imports - you >> just need to use the full name to refer to it. >> >> It looks awfully but it works. >> > I never do that because, as you say, it looks awful. > Consequently, I tend to forget its possible. I also never do it. Maybe nobody besides Stefan does it. Arne