I want to solve this java problem. but i did not proper answer form my code. Below here is my code:
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
double y = sc.nextDouble();
String s = sc.nextLine();
System.out.println("Int: " + x);
System.out.println("Double: " + y);
System.out.println("String: " + s);
}
When I take input int, double and string variable, I can't proper answer. below this code's is input and output:
input:
23
4434.2323
Give output:
Int: 23
Double: 4434.2323
String:
At the input time, i can take int, double variable but i can't take string input. my code return int and double variable. If can anybody help me, I will be benefited.