aspose file tools*
The moose likes Beginning Java and the fly likes Simple questions from a novice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Simple questions from a novice" Watch "Simple questions from a novice" New topic
Author

Simple questions from a novice

vamsi acharya
Ranch Hand

Joined: Jun 28, 2009
Posts: 55

Hey guys , all you java geniuses out there ...i have some simple questions ......

1.) can we write a main method without conventional (String args[]) ???If so or not, why and how ??

2.)can we override a main method ???If so ,give me an example please !

3.) Is documentation of JAVA can be called as API ??


"Known is a drop , unknown is an ocean " !
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18117
    
  39

Well, the best way to learn, and grow past being a novice -- is to try the questions out yourself.

What do you think the answers should be? And why? And have you tried it out yourself? Write a program to test your speculations.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29241
    
139

vamsi acharya wrote:3.) Is documentation of JAVA can be called as API ??

This one isn't really something you can try yourself. The JavaDoc is in fact an API.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
bhavesh bhatnagar
Greenhorn

Joined: Jun 15, 2009
Posts: 26
1.) can we write a main method without conventional (String args[]) ???If so or not, why and how ??
2.)can we override a main method ???If so ,give me an example please !


Yes you can write
but that will be an overloaded method
[ You can have any number of main()]

eg


class MainMethodTesting
{

public static void main()
{
System.out.println("Without Main");
}

public static void main(String[] args) {
MainMethodTesting.main();
}

}


Also note: Program can also be executed witout main().. using static block

Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13875
    
  10

vamsi acharya wrote:3.) Is documentation of JAVA can be called as API ??

API means Application Programming Interface - in the case of Java, it's the set of classes, interfaces and methods that are in the standard Java library. Ofcourse there is documentation of the API.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36499
    
  16
No, you cannot override the common main method because it is static. We have an FAQ about that: look at no 16.
vamsi acharya
Ranch Hand

Joined: Jun 28, 2009
Posts: 55

so JAVA API is a part of a JavaDOC???
Ulises Pulido
Ranch Hand

Joined: Jul 24, 2008
Posts: 81
vamsi acharya wrote:so JAVA API is a part of a JavaDOC???


Errr I believe is backwards, the Java Doc is part of the Java API


SCJP 5.0, SCWCD 5.0, SCBCD 5.0, SCJD, SCEA in progress
www.ulisespulido.com
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36499
    
  16
Javadoc is a tool used to convert documentation comments to the html pages with descriptions of the API. Lots of people call the documentation comments "javadoc" but that isn't really correct.
Steve Jefferson
Greenhorn

Joined: Jul 09, 2009
Posts: 10
Experiment yourself dude and refer to Java API(Yes,the documentation) for the methods you need. Java tutorial from Sun will help you much as a novice.


Project Management Tool | Automatic Scheduling
vamsi acharya
Ranch Hand

Joined: Jun 28, 2009
Posts: 55

Can anyone distinguish between API and documentation of Java???
vamsi acharya
Ranch Hand

Joined: Jun 28, 2009
Posts: 55

Steve Jefferson wrote:Experiment yourself dude and refer to Java API(Yes,the documentation) for the methods you need. Java tutorial from Sun will help you much as a novice.


Can you provide me the URL ???
Gamini Sirisena
Ranch Hand

Joined: Aug 05, 2008
Posts: 347
to put it succinctly..

I would say an API is a collection of interfaces and classes with constructors and methods and fields that allows one to use the functionality of the said collection of software components.

"API documentation" is some documentation which describes the API making it easier for a developer to use the API

Java documentation in general may be the sun java tutorials , other on line resources, above mentioned API documentation etc.
vamsi acharya
Ranch Hand

Joined: Jun 28, 2009
Posts: 55

thank you gamini
Gamini Sirisena
Ranch Hand

Joined: Aug 05, 2008
Posts: 347
Glad to have helped
 
Consider Paul's rocket mass heater.
 
subject: Simple questions from a novice
 
Similar Threads
Dans mock exam 2 ques3
delegate options
The order of main thread & its thread executions
Problem in accessing the in my own package.
Static overloading