Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8355664

Creating I/O API's in JDK to simplify DSA coding and core java learning

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • None
    • core-libs
    • generic
    • generic

      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.



            smarks Stuart Marks
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: