🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #8004

Re: Example???

#8004
From: D. Michael Nelson
Date: Tue, 08 May 2001 23:17
46 lines
2358 bytes
> class Example {
The declaration above has no access atttribute which means that the
permitted access is from any class in the same package (scope is restricted
to within the package - no public interface).  When declaring the class
Simple it needs a public interface inorder to be avaiable to the java
interpreter.
http://java.sun.com/docs/books/jls/second_edition/html/names.doc.html#62666
This link describes the Access Control as used by Java.

>   public static void main(String args[]) {
This is also related the declaration above.  The main method is defined with
a static method attribute.  Before the application starts execution , no
objects exists,but with the static attribute

I hope this helps
Take It Easy,
D. Michael Nelson

public class Simple
{
  // Your program begins with a call to main().
  public static void main(String[] args)
  {
    System.out.println("This is a simple Java program.");
  }
}

Dmitry Skrizhewsky <dskrizhewsky@mail.ru> wrote in message
news:3af85fe5_1@dnews...
> Hi,
> I'm trying to run such a simple program (java Example),
>
> class Example {
>   // Your program begins with a call to main().
>   public static void main(String args[]) {
>     System.out.println("This is a simple Java program.");
>   }
> }
>
> but
> Exception in thread "main" java.lang.NoClassDefFoundError: Example
>
> What is wrong?
>
>
Technical Details
Message-ID: <34%J6.732$ag.19475@news2.atl>
Path: arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!feeds.vnews.net!nntp.cifnet.net!out.nntp.be!propagator-dallas!news-in-dallas.newsfeeds.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.atl.bellsouth.net.MISMATCH!newsfeed.atl!news2.atl.POSTED!not-for-mail
References: <3af85fe5_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,4838aaf1338509e0
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-05-08 16:32:02 PST
Path: arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!feeds.vnews.net!nntp.cifnet.net!out.nntp.be!propagator-dallas!news-in-dallas.newsfeeds.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.atl.bellsouth.net.MISMATCH!newsfeed.atl!news2.atl.POSTED!not-for-mail
From: "D. Michael Nelson" <dmn1@bellsouth.net>
Newsgroups: borland.public.jbuilder.java.language
References: <3af85fe5_1@dnews>
Subject: Re: Example???
Lines: 48
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
Message-ID: <34%J6.732$ag.19475@news2.atl>
Date: Tue, 8 May 2001 19:17:46 -0400
NNTP-Posting-Host: 65.80.84.127
X-Trace: news2.atl 989363583 65.80.84.127 (Tue, 08 May 2001 19:13:03 EDT)
NNTP-Posting-Date: Tue, 08 May 2001 19:13:03 EDT