• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Confused if this is a Java 8 feature  RSS feed

 
Ranch Hand
Posts: 1067
2
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Are the ".map" and ".filter" new to Java 8? 

 
Marshal
Posts: 60136
188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't var a Java9 feature?
What type is newOverridesCollection? The List interface has neither filter() nor map() methods, but the Stream interface has both, introduced in Java8.
 
Sheriff
Posts: 21459
96
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Isn't var a Java9 feature?


Java 10 even.

But the function keywords make me believe this is not Java, but JavaScript. In JavaScript, arrays have map and filter methods since EcmaScript 5.1 (JavaScript 1.6).
 
William Barnes
Ranch Hand
Posts: 1067
2
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All the Java examples I can find on the google, which use .map() or .filter() also have .stream(), which is another thing that confused me about this code. 

So I think you are correct, that this is JavaScript. 

Thanks!
 
author & internet detective
Sheriff
Posts: 38569
659
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
var == Java 10

map/filter == Java 8. However, they operate on a stream, not a collection.

So definitely JavaScript!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!