assertion problem

G

gk

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 ?
 
J

Jean-Francois Briere

<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.
 
D

Daniel Pitts

Jean-Francois Briere said:
<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.
 
C

Chris Uppal

gk said:
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
 
G

gk

Chris said:
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

ok.

can we infer from the above that Orange has the main method ?
 
C

Chris Uppal

gk wrote:

[me:]
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().
[...]
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
 
D

Daniel Pitts

gk said:
ok.

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.
 
G

gk

Chris said:
gk wrote:

[me:]
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().
[...]
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


ok...fine.....this is nice......thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top