The program should output text. - it outputs text
The program must read data from the keyboard. - it reads
The displayed text must contain the entered name. - it contains the name
The displayed text must contain the entered number1. -it contains the number1
The displayed text must contain the entered number2. - it contains the number2
The displayed text must fully match the task conditions. - the taxt fully match.
Is it because of the Byte? Why? :)
package com.codegym.task.task03.task0319;
import java.util.Scanner;
/*
Predictions
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner (System.in);
String name = sc.next();
int number1 = sc.nextInt();
Byte number2 = sc.nextByte();
System.out.println(name + " will receive " + number1 + " in " + number2 + " years.");
}
}