Java Basic Data Types
School Accuracy: 50.01% Submissions: 120 Points: 0

Read a value and store it in the appropriate Java Data Type. 


Example 1:

Input: 
18 
abc 
9.9876 
Output:
18 
abc 
9.9876 
Explanation:
The three inputs are stored in approriate 
data types and then printed in order.

 

Your Task:
Your task is to complete each of the given functions 

javaIntType() : read an integer input, store it in appropriate data type and return it. 
javaStringType() : read a string input, store it in appropriate data type and return it.  
javaFloatType() : read a float input, store it in appropriate data type and return it. 
Each of the function have an object of Scanner in the parameter to be used to read the input.


Expected Time Complexity: O(1)
Expected Auxiliary Space: O(1)

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.

Output Window