answersLogoWhite

0


Best Answer

in your code u always write

public static void main(String args[])

{

//here array args will hold the command line arguments. Indexing from zero for //first argument

//with substring(args[0],1) u can get 1st char of first argument.

}

User Avatar

Wiki User

βˆ™ 11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How you can got the first character of an argument in command line argument in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the character string usually called?

I think, array of string type object in java.actually java take any command line argument in stringformat. bydefault


Please someone explain you command line argument in C?

Command Line Arguments---- I am trying to explain each word one by oneCommand ------perform specific taskex. When CMD is typed in run window and then press ok button then open a black screen that is called command prompt.Command Line ------on command prompt where command is supplied that is called command line.using command prompt dos commands are executed and java program is also executed using command prompt.for executing java program command is supplied with given syntaxjava java_class_name argument1 argument2.........Java--- is a commandjava_class_name ---name of java file which you want to executeargument1 argument2 --- are the values passing to java application from out sidethese argument1 argument2 are stored in string array argument of main method


What is the first Java syntax rule?

Put a ; at the end of each command;


How can I tell which version of Java I have?

From the command-line if you call java with the -version argument then it will display the version number.> java -versionjava version "1.8.0_111"Java(TM) SE Runtime Environment (build 1.8.0_111-b14)Likewise, if you list what programs/applications you have installed then the list should include the version number.


How do you run a java program form the command prompt?

The command is "java", followed by the class name. For example, if your compiled class is called myclass.class, you give the command: java myclass


Command use on how to run a java program?

You execute it the same way you would on any other OS. As long as you have the Java Runtime Environment installed and the "java" executable is in your path, from the command line you would simply run: java -cp /path/to/file/here com.some.class.to.run.Here


What is command to compiler java program?

The command is "javac".


What is a command argument?

Command line arguments are provided at the time of running the program. Example: Suppose that your program needs input name and its value then running it from commandline(DOS prompt) you provide the values after the program name java xyz name JAX(name is name and value is jax)


How do you execute a Java program?

You can run a Java application from the command line using "java <name of the class>"


What is the ' ' called in java?

' ' would be the character for a space in Java.


What will happen if a String array is not provided as the argument to the main method in Java EE?

java takes command line arguments from user so as to execute the program,that's why we always mention arguments for main() , now java always assumes that the argumetns are of String type which may be appropriately converted to any other type later. that is why we pass string array to hold the command line argumetns supplied by the user.


How can sbt be used to build java code?

First of all, you have to start SBT while having java already in the JDK7 folder. You will need to specify Java Home as a command option. This changes the java version to the same one SBT uses.