Scala中路徑依賴代碼實戰詳解之Scala學習筆記-42

來源:互聯網
上載者:User

標籤:

package com.leegh.parameterization

/**
* @author Guohui Li
*/

class Outer {
private val x = 10
class Inner {
private val y = x + 10
}
}

object Path_Dependence {
def main(args: Array[String]): Unit = {
val outer = new Outer
val inner = new outer.Inner
val inner2: outer.Inner = new outer.Inner

val o1 = new Outer
val o2 = new Outer
// val i : o2.Inner = new o1.Inner //報錯
val i : Outer#Inner = new o1.Inner
}
}

 

附:

本部落格說明:

1.整理思路,提高自己。

2.受教於王家林老師,?有所收穫,故推薦。

3.部落格注重實踐,多餘的文字就不多說了,都是做技術的。

4.資訊來源於 DT大資料夢工廠公眾帳號:DT_Spark。?

DT大資料夢工廠的公眾號是DT_Spark,每天都會有大資料實戰視頻發布,請您持續學習。

王家林DT大資料夢工廠scala的所有視頻、PPT和代碼在百度雲端硬碟的連結:http://pan.baidu.com/share/home?uk=4013289088#category/type=0&qq-pf-to=pcqq.group

王家林《Scala深入淺出實戰初級入門經典視頻課程》http://edu.51cto.com/lesson/id-66538.html

王家林《Scala深入淺出實戰中級進階經典視頻課程》http://edu.51cto.com/lesson/id-67139.html

 

Scala中路徑依賴代碼實戰詳解之Scala學習筆記-42

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.