Skip to content

Instantly share code, notes, and snippets.

View andersonbh's full-sized avatar
🏠
Working from home

Anderson Carvalho andersonbh

🏠
Working from home
View GitHub Profile
object Main extends App {
val nomes = Seq("Twing","Twing","Twofi")
def imprimirSeq(seq: Seq[String], filtro: Filtro){
val filtrados = filtro.filtrar(seq)
filtrados.foreach(println)
}
imprimirSeq(nomes, new FiltrarPorNome("Twing"))
imprimirSeq(nomes, new FiltrarPorComecarCom("Tw"))
imprimirSeq(nomes, new Filtro {
def override filtrar(valores: seq[String]) = {