Skip to content

Instantly share code, notes, and snippets.

Martin Anderson bloodredsun

Block or report user

Report or block bloodredsun

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View JavaDefaultMethodMultiInheritanceExample
package com.brs;
// THIS DOES NOT COMPILE!!!
public class JavaDefaultMethodMultiInheritanceExample {
public static void main(String[] args) {
MyOtherJavaExample myJavaExample = new MyOtherJavaExample();
myJavaExample.writeOut();
}
}
View ScalaCleverOverrideTraitExample.scala
package com.brs
object ScalaCleverOverrideTraitExample extends App {
val myExample = new MyExample with TraitOne with TraitTwo ;
myExample.writeOut();
}
trait BaseTrait {
def writeOut()
}
View ScalaOverrideTraitExample.scala
package com.brs
object ScalaOverrideTraitExample extends App {
val myExample = new MyExample ;
myExample.writeOut();
}
trait BaseTrait {
def writeOut()
}
@bloodredsun
bloodredsun / JavaDefaultMethodsExample.java
Last active Aug 29, 2015
Java default method example
View JavaDefaultMethodsExample.java
package com.brs;
public class JavaDefaultMethodsExample {
public static void main(String[] args) {
MyJavaExample myJavaExample = new MyJavaExample();
myJavaExample.writeOut();
}
}
class MyJavaExample implements InterfaceOne {
@bloodredsun
bloodredsun / ExampleThatLogs.java
Last active Oct 24, 2019
Unit testing logback based logging statements
View ExampleThatLogs.java
package com.brs;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Simple class that we use to trigger a log statement.
*/
public class ExampleThatLogs {
You can’t perform that action at this time.