Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Simple questions from a novice

 
Ranch Hand
Posts: 55
Android Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ??
 
author
Posts: 23912
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author & internet detective
Posts: 40912
840
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Marshal
Posts: 74770
336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 55
Android Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so JAVA API is a part of a JavaDOC???
 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Campbell Ritchie
Marshal
Posts: 74770
336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
vamsi acharya
Ranch Hand
Posts: 55
Android Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone distinguish between API and documentation of Java???
 
vamsi acharya
Ranch Hand
Posts: 55
Android Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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 ???
 
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 55
Android Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you gamini
 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Glad to have helped
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic