Object Oriented Programming
Object Oriented Programming
1. Scanner Method
2.
3.
{
Console c=System.console();
String s2=null;
s2=c.readLine("enter the value");
return s2;
JOption Method
public String input3()
System.out.println("enter the input");
String s3=javax.swing.JOptionPane.showInputDialog("enter the text");
return s3;
4. BufferedReader Method
public String input4()throws Exception
{
System.out.println("enter the input");
InputStreamReader isr=new InputStreamReader(System.in);
BufferedReader br=new BufferedReader(isr);
String s4=br.readLine();
return s4;
}