PDA

Click to See Complete Forum and Search --> : new sdk..{resolved}


System_Error
Oct 24th, 2004, 03:18 PM
If I was to get an updated sdk, would I still be able to compile and use older programs? For instance, in the sdk I use right now, for I/O you would use BufferedReader. In the newer sdk they have a Scanner object or something. So would it compile the older programs?

Dillinger4
Oct 24th, 2004, 03:31 PM
Is the Scanner object a replacement or just an added class? You must be using jdk1.5 correct?

Dillinger4
Oct 24th, 2004, 03:42 PM
If you are running say sdk1.5.0 you would be able to compile and run older programs but you would not be able to do the same using an older sdk build if any of your code uses new features found in subsequent versions of the sdk.

System_Error
Oct 24th, 2004, 05:01 PM
Right now I use sdk 1.3..I think. Not too long ago I tried to compile source code made by someone else in sdk 1.5 and I wasn't able to because it had the Scanner object in place of bufferedReader.. Im not sure if it is taking place or if it is just an added class. I just was thinking about upgrading to sdk1.5 and wanted to make sure I coud compile stuff I wrote in 1.3..

Dillinger4
Oct 24th, 2004, 05:51 PM
According the the java docs a java.util.Scanner is a new class and not a replacement for java.io.BufferedReader. Two totally different classes in two different packages. Yeah backwards compatibility for previous sdk builds should be there unless a class was dropped in the new jdk version.

System_Error
Oct 24th, 2004, 07:33 PM
O.K. Well thank you a bunch for your help.

CornedBee
Oct 25th, 2004, 06:59 PM
JDK 1.5 is not fully backwards compatible, even though that was the idea. For example, the org.w3c.dom package in 1.5 contains DOM3 interfaces, older JDKs have DOM2 interfaces. The result is that you can't compile any classes that implement the old interfaces, because they suddenly don't implement the full interface anymore, making them abstract without being marked as such.

Apache Cocoon is one application that fails to compile on 1.5.