Doing a project for class.
Using DrJava compiler.
We've been using
Code
int x = Integer.parseInt(args[0])
(and double, etc) for user inputs so far. I know this converts a user input string to, let's say an integer. But how do I take user input string and keep it as a string. I thought this would work but it doesn't...
Code
String x = String.parseString(args[0])
(says Error: The method parseString(java.lang.String) is undefined for the type java.lang.String)
I've tried googling this but didn't help.
So I ask, what method do I use that takes user input as a string
For example something like this.
Code
public class program
{
public static void main(String[] args)
{
String x = String.parseString(args[0]); // DOESN'T WORK!!
System.out.println(x);
}
}
run program blablabla
output: blablabla
I suck at programming, dont blame me, plz help.