import java.util.Scanner;
class asd
{
public static void main (String[] args)
{
String a="asd",b="acv",c="sfs",ab;
Scanner sc=new Scanner(System.in);
ab=sc.nextLine();
System.out.println(ab);
}
}
This is a java program. I want than if user gives input a or b or c, the value of a or b or c should be printed.
For example if user gives input - a then output should be 'asd'.
Note - Don't use Switch Case or if else statement.
Answers
Answered by
1
use:
String a;
System.out.println("asd");
String b;
System.out.println("acv");
Similar questions