About this talk
In this engaging talk, the speaker, a Java developer at SAP, leads an interactive quiz on identifying different Java versions based on code snippets and features. He introduces various concepts like inner classes, annotations, lambda expressions, and switch expressions, showcasing the evolution of Java through its versions. The audience participates by guessing the version corresponding to each snippet, with insights into when specific features were introduced, from Java 1.1 to Java 21. Throughout the session, he emphasizes the significance of understanding Java's history and features, providing a fun way to learn about the programming language while also offering handmade T-shirts as prizes for top performers in the quiz.
Full transcript
[music] >> Hi, I'm Johannes. Um now here you would for uh for the Java version quiz. And the cool thing is it's one of the only places where you can win something because I I was busy at home and I was making some t-shirts together with Lots of love. And you can win them. It's It's like handmade. I like cut it out with a cutting machine and
so the winner here gets one and I have women sizes, men sizes, big and small. Some of you might have seen a couple of speakers here already having them. Anyway, the the main idea is go to the game and scan it. Yay. I hope it works. I hope Wi-Fi works. You never know. Test test test. Ah, now it's working better. I hope it works. Does anybody have
problems? Ah, now it works. Okay. Let's see. Let's see how many people are in the room. You will see the sign up thing here in the run. Just for for you to know that the following are just Java questions. So, I'm a Java developer at SAP. I work on like the actual OpenJDK. So, I for example got a feature into a JDK 25 and I work at
SAP machine and we're like the third biggest contributor to the OpenJDK and here I'm just because I like Java. I think that's what people have in common. Hopefully. So, the main idea is you guess what Java version this is in and the fastest people get some more points, the slower get less points and essentially the idea is in which which Java version version did you at least
need to run this. This includes both Java features and this includes also of course the language runtimes. And these are checked so they should be correct. So I now give you like 10 seconds. And you can continue can see the static class in there. And so essentially what the whole game here is. Interesting. That's always the fun part because see that that my my app works. >>
[laughter] >> Oh you you guessed correct. It's Java 1.1. It's always funny when you have these when you have these quizzes that people always think like oh this must be a new feature. This shows you how old the current Java that you're writing technically is. So like can take a look. Here's for example it's just that like inner classes were introduced with Java and because of privacy
you all get some really fun names so Fears Dark replied first was was replying in like the first 5 seconds so getting two two points. We have here is a person with warnings in the end and sometimes the examples can be misleading just to make it a bit more funny. And I I am finding quite interesting because these examples are also hard for people that know the
language. Who would have guessed it? That's that's better than the last one at least. Most of you suspected and you probably know why because annotations came in. And yeah, annotation written code. That's just Java 5. Thank you. Okay, the fierce dog is going strong. But also the quick dog. And the jolly panda is like, let's see whether wild flamingo can overtake them. Anyway, um this is also
interesting because you might think there are no new features, but you might have spotted And you should see them on your screen. Yeah, because we're on my big icon seat. So, maybe you have an idea what's going on here. And for the people coming new, just scan the QR code. Ooh, the correct answer was Java 7 and the thing was that binary that binary literals were only
something from Java 7, which I was surprised to when I saw this the first time. And underscores and literals uh came in. So, this is when I start developing Java. Interesting, some of you think it's Java 21. All right, cool. But the next time you write Java 21, I'm like, okay, you're probably just writing Java 7. The quick dog, okay, the dogs are going strong, but also
the turtles are going strong here. Uh going s- going slow? that's the cool thing with privacy. Um Um and here you see something more contrived. I never execute this code, so it could even maybe it's it's there aren't any parsers in there, so don't try to unders- don't don't try to understand what the code actually does. Probably nothing useful. And okay, here here we see it's the
yield statement and it's the switch expressions. I know that many people know that it's that that young. Uh yeah, no, Java Java 8 it isn't because we have like these these errors here. And the cool thing is um and this works also in your single player mode that that you can find by just looking for Java version quiz. You can have here an example where it directly
links to the Java language specification. So, you see that I'm not doing anything wrong. The only problem is that I didn't do any fractional scoring, so >> I I don't have too many t-shirts, so uh These will make it harder. Um >> And yes, it's it's Java 8 just simply because we have lambda expressions and uh these generics in uh oh no, yeah, we have lambda expressions
and who could have guessed this? Interesting. That's a good sign. People are knowing their Java 8. Let's do a fast one. Okay, it's Java 1.1 just because integer class and and that I didn't know either that they were introduced that early because nowadays we use them quite often. Okay, most of you know. I don't It's interesting, I believe when when my quiz which like automates um these
versions here does something where it's like a big gap is far easier. Yeah. Oh, interesting. The mighty flamingo is going going good. Keep up. Um yeah, Here's some interfaces. Maybe something else. There's usually one or two things that like distinguish these code snippets from others. Yes, Java 8 because interestingly enough before Java 8 we didn't have them. So, for like the first 15 years of its existence,
Java didn't have static interface methods, which is a pity. But, most of that's good. I'm surprised. I think we had this before. There must We had this example before. Like I don't know. I was like should I skip it, but What is the attention span of you? It was 5 minutes ago. Who of you thought, "Oh, no. All of the sudden it's Java 8." Like it's >>
Okay, sometimes I'm like Sure. It's fun for me. Oh, but I might be equal. Yeah, it's accumulating. Yeah, yeah. Let's Let's see. Um, is this an interest Oh, yeah. This This is an interesting one. The fun thing is with this quiz you also learn about features that you haven't ever seen before. For example, I didn't know before was doing this quiz that there is something like the
thing that's new here. if you You to learn more, I think there's at least someone in your audience who can explain probably in full detail what it is, but that's not Yeah, this is a concurrent flow. Uh, apparently Java has re- reactive streams. I haven't ever seen them in the wild. Has anyone seen them in the wild? But they are in there. Oh, yeah, Kai Kai was
Kai for for those in the stream, Kai and that's the person that I hinted on that he knows more is like, yes, it's just the interface is none of the implementation. Yeah, Java 9 was a interesting release anyway. It had these modules that were quite nice. But yeah, you can implement some some interfaces here. It's worth chap 266 and that's interesting. Oh, a lot of people knew
or like not yet. >> [sighs] >> there were something different. Recently I've used beans for the first time in a while. Yeah, it's it's from Java 1.1. That is a property change listener is just something to confuse you, but yeah. Oh, That's good. Oh, this this one we had before and people didn't knew what it was. I was standing in the in the room before with with
other people and they were like, oh, what is this object input filter? It's essentially for deserialization. You have filters. Um, they introduced it. Kind of makes sense. Most of you needed is quite old as a feature. Oh, pretty scary never. So, now we have something here. Some of them are simple, some of them not so simple. Yeah, okay. I believe some some examples are just too easy
for you. Maybe this one is too. Maybe some of you spotted the trick. I I generate them for wholly different project and told the LM make them deceiving. And LM is quite good at deceiving. Um yeah, it's drive with effect Oh, yeah, it's it's interesting. Here it's drive with effectively final because the while you are is effectively final. Like five of you knew this. Interesting. This here
is clearly not Java 1.0, but still most people thought it. Anyway. See this here? Yeah. And essentially we're doing this till the time is up. Like we're having fun here. I'm having fun. I hope you too. Um That's Java 10. It's because of list of. That's quite simple. And a lot of other features that my code generates. So this the code behind it that you can point
on to random Java repository and it tells you how many features are used from which which library. Uh from which version. Oh, still still people on there. You're fast. Let's see whether you're correct. Yeah, it's it's Java 5. Nice. No, it's not Java 21. Java 21 was nice, but auto unboxing is not the best feature in Java. Well, that's a bit larger, so I'll give you 10
seconds. Yes, it's it's sequence collections like collections where you can ask the first and the last. It's really annoying when you have code and IntelliJ tells you, "Oh, please replace get zero by get first and your code gets longer." Good. Some of you know Java, that's quite nice here at the conference. Um maybe some of you know this. yeah, these switch expressions are quite Yes, it's Java
14. And also in there came the multiple switch labels. Which is quite nice. Oh, that's that's Let's see. Ha ha ha. It's fun when you have so many keywords. And yes, this is all valid Java code. I tested this. It compiles. Uh but it runs on the test. Um yeah, we have sealed classes and inner classes, so it's Java 17. Um because sealed classes are quite old.
It came after the record parts in Java 16. Just hoping that someone gets the lead so you only have to give out one t-shirt. Ooh. Yeah, enumerations. Um they're quite interesting. They came with Java Who thought it would be coming with Java 24? I don't know. Probably someone who started developing Java lately, but no, yeah, it's it's a Java 5 feature, um and it's a nice feature.
This this should be easy. This was one like of the big features, especially when you're doing web development. It's Java 15. Interesting, yeah, I would have guessed personally Java 21, so on your side. Now, this is a feature that's quite interesting because it broke the Java parser library because the Java library parser library doesn't support parsing this, so it had to patch the Java parser library to
parse it. Do some pre-processing. Um because it's local enums, nobody uses and they're confusing. But they're in with Java 16. Most of you know? I'm surprised. I didn't know them and the Java parser people know don't know them either, so you're better than them. No, they it's a cool project, but it's just not doesn't parse every Java feature. That should be simple. Please. And I feel like
most people It's better than last time. But still how often I think I should probably just do three of them in a row and be like when do they get it all, but uh I think we have like 7 8 minutes left. What's here? Yeah, it's just type annotations. You can annotate the type. Quite interesting. Yeah, it's quite interesting these versions are close together because most people
like at least in this room from from like the ages that I can can see here, probably learned Java in this in this area. At least I did with Java 7, so it's quite This is also some some feature that you might never use because you're not like me, like someone that does profilers. But for me it was quite an interesting feature. It's the stack walker API,
so you can walk the stack. Actually, and yeah, most of you didn't know, but that's in with Java 9. It was really That should be easy. You've seen No, no. You haven't seen this today before like, but I I hope it's easy. Please. Java 20 Java 20 Okay, yeah. But the fun thing is when people are like, "Oh, um I need the newest Java versions and they
don't even know the features of the Java version that they're currently using." So, this is why I might the game. Um This Java 21, it's with these interesting parameter things that are in the source of trouble if you do puzzlers, but most of you already know. Um Yeah, what do we have here? We have again some driver for resources. What is this all? Yeah, it's just all
driver resources. That's Java 7. Most of you know. The fun thing is this application didn't crash, which is better than the last This lit That's That's Java 8 because of lambdas and method references. These are quite old features, but it looks modern. And you all know. Haha. Quick ones. I know it's hard to guess, but maybe you have an idea which Java version it is. Yes, Java
7. It's Java 7 resources. The questions are randomly chosen, so. And no, I haven't heard of this before I did the quiz. XML is a interesting. Oh, yeah, it's it's it's Java 6 because the whatever bind API that you can use to do things. Interesting. A lot of people knew. It should be easy. >> And it is easy. >> Um let's let's do two more questions and
then I think my time should be almost up. Yeah, uh it's essentially Java 3 that came in in 1.4. Oh, not that many people knew. Yeah, Java Java had a search statement didn't have a search statements before they were introduced. Um and there's even a JSR 41. So, the thing is we can literally click on this and you can directly see the specification request. So, it helps
you learn the language. Good. And now to the last question. >> But that's Java 101. That's surprising. I didn't know that like interfaces, local interface, and local enums came so late, but local classes were quite early. But um and now who who is the brave owl? Yeah, then come come in front. What's your shirt size? >> [applause] >> I'm a little too scared. Oh, shh. That's the
problem like uh I think I only have L if I'm honest. Okay, it's for my little kid. Yeah, I think I Did I have Yeah, probably Yeah, that's women's size. Okay. Thank you. I hope you had a good time. If you want if you want to do it yourself, uh this is just the conference mode. Uh you can of course go to the Java version quiz. Just
Google Java version quiz and um here you find it. It's just Yeah. Google this and you'll be fine. The fun thing here is and I can show you in the end there's also an object sizes quiz where you can guess the size of the objects where you can guess the size of the value. And I think it's it should be 48 bytes with the compact headers on.
Without it's different, so you can learn that Java is Yeah, you can also learn why you shouldn't write boxing is problem Oh, it's 16 bytes. Okay, it's better than expected because it's a small value. So, whatever. You see you can you can learn how big these are. And if you're true nerd, what you can also do is you can enable Java alpha where integrated the Java alpha
versions in there. Uh let's let's find one where you have the questions added with some some older of the first Java version. Maybe you Feel free to to play this game. It's Yeah, it's it's privacy aware. It just runs in your browser. And have a nice time at the conference and enjoy the next talk. >> [music]
More from this event
See all 34 talks →
Java: 30 Years and Beyond | Ana Maria Mihalceanu (EN)
39:47
Scaling Data in a Sovereign AI Platform | Johann Strauss & Markus Kett (EN)
49:29
Code Is Cheap. Software Isn’t. | Markus Eisele (EN)
47:23
Building a Digital Product Passport with Java and Cardano | Fabian Bormann (EN)
46:54