GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  J2EE  >  Core Java
Go To First  |  Previous Question  |  Next Question 
 Core Java  |  Question 409 of 502    Print  
Why do we write String args[] in main of the program?

  
Total Answers and Comments: 2 Last Update: March 11, 2008     Asked by: manohar 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: sampra
 
we are writing String(as[]) beacuse it is very easy to change from string to any data type

Above answer was rated as good by the following members:
talktoatish
July 29, 2007 06:33:41   #1  
sujatham Member Since: January 2006   Contribution: 142    

RE: Why do we write String args[] in main of the progr...
to store command line arguments.
 
Is this answer useful? Yes | No
March 11, 2008 07:39:36   #2  
sampra Member Since: February 2008   Contribution: 278    

RE: Why do we write String args[] in main of the program?
we are writing String(as[]) beacuse it is very easy to change from string to any data type
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    

 Related Questions

Can we declare multiple main() methods in multiple classes.ie can we have each main method in its class in our program?

Latest Answer : Firstly take the User input as String using the BufferedReader API.Call br.readLine();Once you get the input Use .ValueOf method for conversion.  Eg: String MyString; BufferedReader br = ............; MyString = br.readLine(); ...
Read Answers (6) | Asked by : Prashu

give me answer 
Latest Answer : public class CSingleton {   private static CSingleton inst= null;private static int count=0;protected CSingleton() {                        ...
Read Answers (5) | Asked by : chandu

give me answer 
Latest Answer : We can use clone() method to create another instance of a singleton class.Example:SingletonObjectClass obj = SingletonObjectClass.createSingletonObject();SingletonObjectClass clone = (SingletonObjectClass) obj.clone();java.lang.Object class has a clone ...
Read Answers (1) | Asked by : chandu

Latest Answer : I think this is the one of the way to return two refference fro one ObjectClassA extends from ClassBthenin ClassBwe can write like thisClassB b=new ClassB();this is one andClassA a= new ClassB();this is twoof course at complie time it seems to be same ...
Read Answers (1) | Asked by : chandu

br />1.what is oracle.2.what is major differenece oracle8i and oracle9i.4.tell me some thing ur self.5.please tell me about oops.6.what is single inheritance.7.what is multiple inheritance.8.can java support 
Latest Answer : 8.can java support multiple inheritance.java support multiple inheritance for interfaces not fro classes25.what is difference between procedure and functions.function returns only one value where as procedure returns more than one value ...
Read Answers (11) | Asked by : rajjava

Latest Answer : Bez byte code genrated and understtod same on each compiler ...
Read Answers (4) | Asked by : Beena

Latest Answer : C++ can be used in java program by using Native API. There are 4 types of drivers in JDBC. Native API/Partly java driver is one of the type, which is used to connect the C++ code in Java Program ...
Read Answers (4) | Asked by : Beena

Latest Answer : we can write our own exceptions by extending them either from Throwable or from Exception.class Example1{    public static void main(String[] args) throws MyException {                ...
Read Answers (4) | Asked by : chandu

plz give answer 
Latest Answer : only main thread execute at that time ...
Read Answers (8) | Asked by : Shajahan


 Sponsored Links

 
Related Articles

Service Oriented Java Business Integration Review

Service Oriented Java Business Integration Review Introduction If you ve read through the texts which give you an introduction to SOA or Web Services you will often find them to be quite frustrating and the reason for this is because they spend too much time referencing business processes which are
 

C++ String Representation and Handling

C String Representation and Handling In this C tutorial you will learn about string representation and handling how is string represented end string notation initializing char array character representation string literals example programe to understand the character array concept and the accessing
 

Java and Client Server Models

Java and Client Server Models The Role of Client Servers on the Web Client server models provide the essential mechanisms for working with the Internet In fact most of the World Wide Web is built according to this paradigm In client server models the web browsers run by millions of users are the cli
 

JavaScript String Object

JavaScript String Object In this JavaScript tutorial you will learn about String Object purpose of string object in JavaScript purpose of string object indexof method lastIndexOf method and substring method along with syntax and example mosgoogle center Purpose of String Object in JavaScript The mai
 

Convert a String into an Integer

How to convert a string into an integer in C program? This is done by using the function named as atoi(). This function atoi() is present in the header file named as <stdlib.h>. When programmers use this function they must include the header file by the statement #include <stdl
 

String handling functions

What is the string handling functions present in header file <string.h>? There are number of string handling functions present in string.h. In other words if a programmer uses any of the function present in string.h then they must include the header file as #include <string.h&am
 

Convert a String into Long Value

What string function is used to convert a string into long value? This is done by using the function named as atol() . This function atol() is present in the header file named as <stdlib.h>. When programmers use this function they must include the header file by the statement
 

How is the main() function declared?

The declaration of main can be done as int main() One more declaration that can be taken by main is command line arguments form int main(int argc, char *argv[]) or this can also be written as int main(argc, argv) int argc; char *argv[]; NOTE: It is not possible for one to declare the main
 

What happens when a variable is not initialized in main function?

When a variable is not initialized in main function it contains garbage value. This can be well seen from the example below main() { int x; printf(“%d”,x); z= sample() } sample() { printf(“Testing program”); } Output is   &n
 

How to develop compile and run a C program

The steps involved in building a C program are: 1. First program is created by using any text editor and the file is stored with extension as .c 2. Next the program is compiled. There are many compilers available like GNU C compiler called as gcc, Sun compiler, Borland compiler which is pop
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape