Answer:
import java.util.Scanner;
public class num2 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Enter Name");
String name = in.next();
System.out.println("Enter Age");
int age = in.nextInt();
System.out.println("The age of "+name +" is "+age);
}
}
Explanation:
Java programming language is used to write the code.
The scanner class is used to prompt and receive values for name and age which are stored in the appropriate variables.
The key idea here is using string concatenation in the output statement in order to print the desired output