Java Generic Class
Submissions: 279   Accuracy:

57.69%

  Difficulty: Basic   Marks: 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

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: S_A
Author: saksham0751


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.