Deprication details....

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • leelaramtenneti
    New Member
    • Jan 2007
    • 9

    Deprication details....

    Uses or overrides a deprecated API. ------- This is the message shown while compiling java program and what should be done to avoid this ???
  • horace1
    Recognized Expert Top Contributor
    • Nov 2006
    • 1510

    #2
    Originally posted by leelaramtenneti
    Uses or overrides a deprecated API. ------- This is the message shown while compiling java program and what should be done to avoid this ???
    it means that one of the classes or methods you are useing has been replaced with a another (one hopes better) alternative. The original should still work OK. To get full details compile the program with the -Xlint option which enables warning messages. If you go to the java documentation on the class in question it will tell you what has replaced it.

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      Originally posted by leelaramtenneti
      Uses or overrides a deprecated API. ------- This is the message shown while compiling java program and what should be done to avoid this ???
      The code will run fine if it has no other errors but it is very bad practice to use deprecated code.

      Comment

      • leelaramtenneti
        New Member
        • Jan 2007
        • 9

        #4
        readLine() in java.io.DataInp utStream has been depricated. What can be used instead of that to get input from keyboard ???

        Comment

        • leelaramtenneti
          New Member
          • Jan 2007
          • 9

          #5
          How to avoid deprecation errors ?????

          readLine() in java.io.DataInp utStream has been depricated. What can be used instead of that to get input from keyboard ???

          Comment

          • r035198x
            MVP
            • Sep 2006
            • 13225

            #6
            Originally posted by leelaramtenneti
            readLine() in java.io.DataInp utStream has been depricated. What can be used instead of that to get input from keyboard ???
            Do not use DataInputStream . Use the java.util.Scann er class instead.

            Comment

            • r035198x
              MVP
              • Sep 2006
              • 13225

              #7
              Originally posted by leelaramtenneti
              readLine() in java.io.DataInp utStream has been depricated. What can be used instead of that to get input from keyboard ???
              Please do not double post for the same problem.

              Comment

              • ssiddhanta
                New Member
                • Jul 2008
                • 1

                #8
                You should use BufferedReader instead of DataInputStream
                Example:
                BufferedReader br=new BufferedReader( new InputStreamRead er(System.in));


                Siddhanta

                Comment

                • JosAH
                  Recognized Expert MVP
                  • Mar 2007
                  • 11453

                  #9
                  Originally posted by leelaramtenneti
                  readLine() in java.io.DataInp utStream has been depricated. What can be used instead of that to get input from keyboard ???
                  I bet your didn't bother to read the API documentation for the method because
                  for deprecated items the documentation gives you an alternative way of getting
                  done what you want to get done. I am not going to repeat the API documentation
                  for you.

                  kind regards,

                  Jos

                  Comment

                  • ajos
                    Contributor
                    • Aug 2007
                    • 283

                    #10
                    Originally posted by JosAH
                    I bet your didn't bother to read the API documentation for the method because
                    for deprecated items the documentation gives you an alternative way of getting
                    done what you want to get done. I am not going to repeat the API documentation
                    for you.

                    kind regards,

                    Jos
                    Jos you just replied to thread which is 1.5 years old ;)

                    regards :)

                    Comment

                    • JosAH
                      Recognized Expert MVP
                      • Mar 2007
                      • 11453

                      #11
                      Originally posted by ajos
                      Jos you just replied to thread which is 1.5 years old ;)

                      regards :)
                      Huh? Oh darn, now I see it: it was reply #8 that bumped it up again. Silly me ;-)

                      kind regards,

                      Jos

                      Comment

                      Working...