惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
Netflix TechBlog - Medium
G
Google Developers Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
GbyAI
GbyAI
L
LangChain Blog
云风的 BLOG
云风的 BLOG
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
小众软件
小众软件
WordPress大学
WordPress大学
A
About on SuperTechFans
大猫的无限游戏
大猫的无限游戏
C
Check Point Blog
月光博客
月光博客
Stack Overflow Blog
Stack Overflow Blog
美团技术团队
Jina AI
Jina AI
T
Tailwind CSS Blog
Google DeepMind News
Google DeepMind News
D
Docker

Scala

这个分类好久没新帖子了,记录下最新用 scala 3 写的项目 sbt run 的时候,能不能跳过 compile 直接 run? 还有必要用 scala 吗 有 scala 兄弟吗?有招 scala 的公司吗? Scala 单元测试 scala 模型导出问题 想用 Springboot 做后端接口,但组里 scala 大佬希望我用 Akka Http 怎么办 可能是家庭背景最深厚的程序员写的书... 集合类型 filter 后执行 foreach 的效率 比 foreach 里写 if 来的慢 sbt 为什么能这么垃圾? sbt 1.3.0 released, 依赖管理从 ivy 变为 Coursier 如何停止已经提交到 Spark 集群上的任务? Scala 元编程:在日志库中的应用 请教下关于用 Flume+kafka+Spark 实现实时监控错误日志报警的功能 闲话 Scala Native: 初次见面,请多多关照 Scala 中不带具体实现的 object 是什么用法 scala 命令行删除字符不能正常显示 spark 技术面试被问到个问题,有点问懵逼了,求指点 scala 中 _ 的语法问题 [小广告] scala 中文 telegram 群组: t.me/scala_zh Scala 中国社区、微信群? Scala's types of types 译文 Scala 自学笔记-参考书籍 Programming in Scala 第三版 scala 如何实现某个代码段同一时刻只能有一个进程在读,其他进程只能等待。 请问该怎样结合实践去学习 Scala,谢谢! 欢迎来访开放源码的 PlayScala 社区(http://www.playscala.cn) 请问我下载了乌云的 digatalAllData,说明上写着用 case class 解析出数据,那有没有详细的方法? 嘿,Scala 这货你们都应用在什么项目上了,打算接触试试呢~ sbt package 将 scala 源代码一并打包进去? 大家都用什么 orm 或 mysql db library
关于《Scala 编程(3rd)》中, 20.6 抽象类型 P424 的疑问
zhenwang · 2019-07-03 · via Scala

在《 Scala 编程( 3rd )》中,20.6 抽象类型这一节中,本人有个非常不解的地方,书中提到:

class Food

abstract class Animal {
  def eat(food: Food)
}

class Grass extends Food

class Cow extends Animal {
  override def eat(food: Grass) = {}	// 这不能编译
}					// 如果能的话...

class Fish extends Food

val bessy: Animal = new Cow

bessy eat (new Fish) // ...你就能给牛吃草了

本人理解 override 超类方法,方法参数是不支持协变的,但是上文假设通过编译,"bessy eat (new Fish)"不是本来就不能运行吗? Fish 本来就不能上转型为 Grass 呀。何况如下重写 eat 方法岂不是同样有这个问题?

class Cow extends Animal {
  override def eat(food: Food): Unit = {}
}

val cow = new Cow

cow eat new Fish
// 能通过编译且运行

小弟不才,一直没理解,希望各位大佬轻喷