以下代码:
public class Test {
public static void main(String[] args) {
Stream.of(1,2,3).map(String::valueOf).collect(Collectors::toList)
}
}
Run Code Online (Sandbox Code Playgroud)
intellij告诉我:
Collector<String, A, R> 不是功能界面
但是当我按如下方式修改代码时,一切都还可以,我不知道为什么?
public class Test {
public static void main(String[] args) {
Stream.of(1,2,3).map(String::valueOf).collect(Collectors.<String>toList());
}
}
Run Code Online (Sandbox Code Playgroud) 在Scala中,yield可以使用for循环; 例如:
val ints: IndexedSeq[Int] = for(i <- 1 to 10) yield i
Run Code Online (Sandbox Code Playgroud)
但我发现yield无法使用while循环,例如:
while (resultSet.next()) yield new Row(resultSet)
Run Code Online (Sandbox Code Playgroud)
为什么Scala设计得像这样?
我在Google和stackoverflow上搜索过,但找不到答案.
我创建了一个新的rails项目,然后添加
gem 'bootstrap-sass'
Run Code Online (Sandbox Code Playgroud)
到我的Gemfile,然后我运行bundle install,一切都很顺利.然后我补充说:
/*
*= require bootstrap
*/
Run Code Online (Sandbox Code Playgroud)
在我的application.css文件中,我写了一个测试,但它没有.我也尝试添加`@ import"bootstrap"; 在我的hello.css.scss文件中.但它也不起作用.