aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Can the main method be declared native? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "Can the main method be declared native?" Watch "Can the main method be declared native?" New topic
Author

Can the main method be declared native?

Kareem Qureshi
Ranch Hand

Joined: Mar 14, 2002
Posts: 102
which modifiers would be valid in the declaration of a main() method so that the class can be run from command line?
The choices are
1.native
2.protected
3.public
4.final
5.abstract
the answers are 1,3,4
the explanation for choice 1 is given as
But then this method must be implemented in .dll or other shared library otherwise it will throw an unSatistiedLinkError
Can anybody explain whether this is part of SJCP2
Thanks in advance
Kareem
Rob Ross
Bartender

Joined: Jan 07, 2002
Posts: 2205
Actually, yes, you should know that you can make main() a native method.
The UnsatisfiedLinkError though is not part of the requirements.


Rob
SCJP 1.4
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can the main method be declared native?
 
Similar Threads
native??
native abstract
native
Native Method
Can main( ) be declared as private