You are here:

Java/java conversion

Advertisement


Question
char s = args[0].char(0);
what does this statement mean

Answer
Do you mean:
char s = args[0].charAt(0)

which might be in:
public static void main(String[] args) {

}

which means get the first character, charAt(0), of the first argument, args[0], that was passed into the program.

So if the program was run with:

java -jar myJar.jar ball cat

The char s would be 'b'.

Java

All Answers


Answers by Expert:


Ask Experts

Volunteer


Artemus Harper

Expertise

I have a Masters in computer science. I can answer questions on core J2SE, swing and graphics. Please no questions about JSP or J2ME.

Experience

I have experience in Core Java, good background in Java swing/gui, some experience with JNI, Java reflection. Some experience in bio-informatics. Basics in c++ and c#

Organizations
Washington State University

Education/Credentials
MS in Computer Science from Washington State University and a BS in Mathematics and Computer Science from Central Washington University.

©2016 About.com. All rights reserved.