Java Generic Class
Basic Accuracy: 64.3% Submissions: 661 Points: 1

Generic Class in java  is a feature. We write code once and use it for any data type including user defined data types. Given an integer or a string as an input.Print the type of input and the given value as output.

Input: 
The first line will contain an integer (number of test cases). First line of each test case will contain one integer c. Next line will contain a string if c is equal to 1 or will contain a integer if c is equal to 2.

Output: 
Print the type of the given data and the given value in new line.

Constraints: 
1 < = T < = 100
1 < = c < = 2
1<= Length of strings, integers<=103

Example:
Input:

2
1
gfg
2
5

Output:
String
gfg
Integer
5

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.