Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2006

Tip: Looking for answers? Try searching our database.

assertion problem

Thread view: 
gk - 05 Nov 2006 20:16 GMT
Say,The package favorite.fruits contains different classes for
different fruits. Orange is one of the classes in this package. Assume
that all the classes from this package are compiled with assertions
enabled.  The following will enable assertions at runtime for this
package, but will disable it for the class Orange, using standard JDK
1.4

    java -ea:favorite.fruits... -da:favorite.fruits.Orange <Main Class>

i am confused with this syntax "<Main Class>"
what does it mean by  "<Main Class>"  here ?
does it have any special meaning ?
do they want to mean Orange has the main method in it ? so Orange is
the Main Class ?
do i need to type "<Main Class>" as above ?
Jean-Francois Briere - 05 Nov 2006 20:49 GMT
<Main Class> means : The class with the main() method to execute which
is the entry point of your Java program.
Exactly like any other Java program execution:
java <Main Class>
It has nothing to do with assertions.
Daniel Pitts - 05 Nov 2006 22:32 GMT
> <Main Class> means : The class with the main() method to execute which
> is the entry point of your Java program.
> Exactly like any other Java program execution:
> java <Main Class>
> It has nothing to do with assertions.

They mean specifically to type in the fully qualified name of your
class that has the public static void main(String[] args) entry point.

For example "java net.virtualinfinity.myproject.MyMainClass"
Jean-Francois is right, it has nothing to do with assertions.
Chris Uppal - 06 Nov 2006 13:12 GMT
> i am confused with this syntax "<Main Class>"

Quite often in computer programming, when someone writes (in documentation,
comments, web-pages, Usenet...) something like

   do something with <XYZ>

they mean that you should replace <XYZ> with something appropriate to the
context.  Usually the text in the <> will indicate roughly what sort of thing
is expected.  In your case the documentation is telling you to replace <Main
Class> with the name of a class -- the one containg main().

If you think about it, Java's use of <> in generics is a bit similar.

   -- chris
gk - 06 Nov 2006 15:53 GMT
> > i am confused with this syntax "<Main Class>"
>
[quoted text clipped - 11 lines]
>
>     -- chris

ok.

can we infer from the above that Orange has the main method ?
Chris Uppal - 06 Nov 2006 17:19 GMT
[me:]
> > Quite often in computer programming, when someone writes (in
> > documentation, comments, web-pages, Usenet...) something like
[quoted text clipped - 6 lines]
> > you to replace <Main Class> with the name of a class -- the one
> > containg main().
[...]
> can we infer from the above that Orange has the main method ?

No, not at all.  Why should we be able to infer that ?

   -- chris
gk - 07 Nov 2006 02:22 GMT
> [me:]
> > > Quite often in computer programming, when someone writes (in
[quoted text clipped - 13 lines]
>
>     -- chris

ok...fine.....this is nice......thanks
Daniel Pitts - 06 Nov 2006 20:52 GMT
> > > i am confused with this syntax "<Main Class>"
> >
[quoted text clipped - 15 lines]
>
> can we infer from the above that Orange has the main method ?

You can't infer the main method. You have to create it.
Classes only define structure, you have to create an "entry point" into
your program.  The entry point (usually a main method) tells the
computer what to do, such as create an object or execute a method call.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.