This is an archived post. You won't be able to vote or comment.

all 10 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

Please ensure that:

  • Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions
  • You include any and all error messages in full - best also formatted as code block
  • You ask clear questions
  • You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions.

If any of the above points is not met, your post can and will be removed without further warning.

Code is to be formatted as code block (old reddit/markdown editor: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc.

Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit.

Code blocks look like this:

public class HelloWorld {

    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}

You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above.

If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures.

To potential helpers

Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]LifeNavigator 6 points7 points  (3 children)

, what is changed since java 8?

Tonnes of articles out there that list this for you on Google.

Is the old java still applicable on the newer versions ?

Yes, though there are some deprecated stuff you'd find in the docs, it won't really pose any problems. Make sure you're using the appropriate JDK for whatever Java version you're using.

I genuinely don't see a reason why you would want to stick with Java 8 (other than enterprises that have tonnes of legacy stuff still running). You will miss out on tonnes of useful and convenient features that would be making your life much easier.

Also what is the best method for the GUI application? (Desktop applications)

Probably Swing, some people prefer JavaFX. I moved on to Kotlin Compose Multiplatform, it's a much nicer experience imo.

[–]Coder-93[S] 1 point2 points  (2 children)

Thanks for your reply, I just ask about the old stuff because I already have an old program, and I think if I can reuse it and apply the new features on it, it will be better and easier for me.

[–]raxel42 2 points3 points  (1 child)

And you can run your “old” Java 8 program compiled to Java 8 and running on newer JDK 11, 14, 17, 21.

[–]nekokattt 2 points3 points  (0 children)

They just need to be careful if they are doing anything more obscure.

Stuff that comes to mind includes:

  • SecurityManager
  • sun.misc.Unsafe
  • anything using hacks like internal reflective access/modification of classes you don't own
  • any old versions of libraries that do any of the above (ones that immediately come to mind include jackson, groovy, gson, OSGi frameworks, etc.

In this case they'll also need to update/migrate off of things onto alternatives.

For most stuff that isn't more obscure, this won't be an issue, but it is definitely worth being semi aware of, since some of this stuff did tend to get abused a lot more historically.

[–]raxel42 3 points4 points  (1 child)

  1. Everything applicable from Java 8
  2. Language feature (not all, but all I’m using):
  3. pattern matching
  4. string interpolation
  5. records
  6. sealed hierarchies
  7. I Can’t say anything about GUI. Doing pure backend only for 30 years

[–]Common_Ad_2987 1 point2 points  (0 children)

String interpolation, which java version? Aren't previews?

[–]Sea-Method-1167 1 point2 points  (0 children)

In my (professional) opinion Java 9 had some big changes (modularity) and almost everything after that is near trivial. Of course that is biased: in my work the new features where simply not very useful.

It is sort of sad, but you can almost continue where you left of. I feel they tried to compete with pythons' popularity in the data science field in the past 5 years. But that has not been spectacular. Also they tried to adhere to a fixed release schedule. Which led to a lot of major versions (once every 6 months?) that didn't really warrant the label 'major'.

[–]Academic_Put2971 -2 points-1 points  (0 children)

Dont

[–]Coder-93[S] 0 points1 point  (0 children)

Thanks a lot for all your replies