Answer:
// here is code in java.
import java.util.*;
// class definition
class Solution
{
// main method of the class
public static void main (String[] args) throws java.lang.Exception
{
try{
// scanner object to read the input from user
Scanner s=new Scanner(System.in);
System.out.println("Please enter the month:");
// read the month from user
int birthMonth=s.nextInt();
System.out.println("Please enter the year:");
// read the year from user
int birthYear=s.nextInt();
// print the output
System.out.println(birthMonth+"/"+birthYear);
}catch(Exception ex){
return;}
}
}
Explanation:
Read the value of month and year from user with the help of scanner object and assign them to variables. then print the month and year separated by a slash "/".
Output:
Please enter the month:1
Please enter the year:2000
1/2000