File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed 
tp3/src/main/kotlin/fmt/kotlin/fundamentals Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 11package  fmt.kotlin.fundamentals 
22
3+ import  fmt.kotlin.fundamentals.cellar.Cellar 
4+ import  fmt.kotlin.fundamentals.cellar.WineBarrel 
5+ 
36fun  main () {
47    val  tooBigBarrel =  WineBarrel (600 )
58
Original file line number Diff line number Diff line change 1- package  fmt.kotlin.fundamentals 
1+ package  fmt.kotlin.fundamentals.cellar  
22
33class  Cellar  private constructor(
44    ownerName :  String ,
@@ -41,7 +41,7 @@ class Cellar private constructor(
4141             
4242        """  .trimIndent()
4343
44-         for (wineBarrel in  wineBarrels) {
44+         for   (wineBarrel in  wineBarrels) {
4545            description + =  wineBarrel.description() +  " \n " 
4646        }
4747
Original file line number Diff line number Diff line change 1- package  fmt.kotlin.fundamentals 
1+ package  fmt.kotlin.fundamentals.cellar  
22
33class  WineBarrel  private constructor(
44    val  capacityInLiters :  Int  = 225 ,
55    private  var  wineAgeInMonths :  Int 
66) {
7-     fun  age (monthsNumber :  Int ) {
7+     private   fun  age (monthsNumber :  Int ) {
88        wineAgeInMonths + =  monthsNumber
99    }
1010
@@ -21,7 +21,7 @@ class WineBarrel private constructor(
2121        }
2222    }
2323
24-     fun  description (): String  {
24+     internal   fun  description (): String  {
2525        return  """ 
2626            Capacité en litres: $capacityInLiters  
2727            Âge du vin : $wineAgeInMonths  
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments