Skip to content
Advertisement

Tag: enumeration

How to use enum key value in java

I want to create an enum class in java 11 with key value I create a enum like this the problem that when i do Saison saison.getvalues() i got like this But i want to got like this how can i call my enum tio get a result like this Answer There is nothing to prevent you from returning a

Iterate an Enumeration in Java 8

Is it possible to iterate an Enumeration by using Lambda Expression? What will be the Lambda representation of the following code snippet: I didn’t find any stream within it. Answer In case you don’t like the fact that Collections.list(Enumeration) copies the entire contents into a (temporary) list before the iteration starts, you can help yourself out with a simple utility

Advertisement