Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • 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:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Confused if this is a Java 8 feature

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

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

 
Marshal
Posts: 69382
276
  • 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: 21941
106
Eclipse IDE Spring VI Editor Chrome Java Ubuntu 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 Spring Java
  • 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
Posts: 39986
806
Eclipse IDE VI Editor Java
  • 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!
 
Sometimes you feel like a nut. Sometimes you feel like a tiny ad.
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic