A DESCRIPTION OF THE PROBLEM :
As a student/new learner/experienced programmer etc., I have to use some common code to perform I/O operations while coding DSA questions which has some concerns in my perspective:
1. It takes new java programmers to learn it. Eg: What and how Scanner and other Java I/O api's works.
2. I have to use SOUT everytime to print the output along with for loops sometimes for List of objects.
While the same thing takes lesser time to learn it with Python which has been mostly adopted by new comers from the past few years becuase of its simplicity with i/o required to learn in the starting phase of developer /student career.
Can we add new API's like Python in java to simplify I/O process?
Eg: Python code
name = input("Enter your name: ")
print("Hello, " + name + "!")
age = input("Enter your age: ")
age = int(age) # Convert to integer
print("You are", age, "years old.")
In Java can we define input() and output() function in wrapper classes to make it more simple to read from console? Then I don't have to use Scanner APIs for Input and SOUT for ouput operation in my java DSA code.
Similarly we could also introduce input() and output() methods with array and collection classes to make java easy to use and understand.
One could create its own API's and use it while learning DSA/Core java but I believe this small change will really help us.
I am happy to share more insights into this idea and can contribute to it if required.
As a student/new learner/experienced programmer etc., I have to use some common code to perform I/O operations while coding DSA questions which has some concerns in my perspective:
1. It takes new java programmers to learn it. Eg: What and how Scanner and other Java I/O api's works.
2. I have to use SOUT everytime to print the output along with for loops sometimes for List of objects.
While the same thing takes lesser time to learn it with Python which has been mostly adopted by new comers from the past few years becuase of its simplicity with i/o required to learn in the starting phase of developer /student career.
Can we add new API's like Python in java to simplify I/O process?
Eg: Python code
name = input("Enter your name: ")
print("Hello, " + name + "!")
age = input("Enter your age: ")
age = int(age) # Convert to integer
print("You are", age, "years old.")
In Java can we define input() and output() function in wrapper classes to make it more simple to read from console? Then I don't have to use Scanner APIs for Input and SOUT for ouput operation in my java DSA code.
Similarly we could also introduce input() and output() methods with array and collection classes to make java easy to use and understand.
One could create its own API's and use it while learning DSA/Core java but I believe this small change will really help us.
I am happy to share more insights into this idea and can contribute to it if required.
- duplicates
-
JDK-8344699 JEP 512: Compact Source Files and Instance Main Methods
-
- Proposed to Target
-