Hi Sarjana Panda,
u can take input in java at runtime using couple of ways the best way i feel is illustrated below
import java.io.*;//note that this import statement is must because we are using a class of that package
public class runtime
{
public static void main(String[] args)
{
try
{
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
System.out.println("enter some string");
String x = br.readLine();//this line reads the entered string at runtime and stores it in string variable x
System.out.println("the string u entered is "+x);
}
catch(Exception e)
{
System.out.println("some error occurred);
}
}
}//end of class runtime
Output:
enter some string
Sarjana Panda
the string u entered is Sarjana Panda
Feb 17, 2011