Leaderboard
Showing:
Handle Score
@Ibrahim Nash 5725
@blackshadows 5685
@akhayrutdinov 5111
@mb1973 4989
@Quandray 4908
@saiujwal13083 4156
@sanjay05 3762
@marius_valentin_dragoi 3511
@sushant_a 3453
@KshamaGupta 3318
@the_coder95 3302
Complete Leaderboard
Java Basic Data Types
School Accuracy: 52.31% Submissions: 174 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.

Java Basic Data Types

Output Window