This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.brs; | |
// THIS DOES NOT COMPILE!!! | |
public class JavaDefaultMethodMultiInheritanceExample { | |
public static void main(String[] args) { | |
MyOtherJavaExample myJavaExample = new MyOtherJavaExample(); | |
myJavaExample.writeOut(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.brs | |
object ScalaCleverOverrideTraitExample extends App { | |
val myExample = new MyExample with TraitOne with TraitTwo ; | |
myExample.writeOut(); | |
} | |
trait BaseTrait { | |
def writeOut() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.brs | |
object ScalaOverrideTraitExample extends App { | |
val myExample = new MyExample ; | |
myExample.writeOut(); | |
} | |
trait BaseTrait { | |
def writeOut() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.brs; | |
public class JavaDefaultMethodsExample { | |
public static void main(String[] args) { | |
MyJavaExample myJavaExample = new MyJavaExample(); | |
myJavaExample.writeOut(); | |
} | |
} | |
class MyJavaExample implements InterfaceOne { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.brs; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
/** | |
* Simple class that we use to trigger a log statement. | |
*/ | |
public class ExampleThatLogs { |