This file contains hidden or 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
public static void main(String[] args) { | |
// this uses a java 8 feature called method references (i think) | |
// it looks for method "aThingToDo" in class "methoding" (the name of this class) | |
// aThingToDo must match the pattern, as doAThing says | |
doAThing(methoding::aThingToDo); | |
} | |
// define a pattern for what type of method we want | |
// we want a method with String s as input and no return (void) | |
public interface voidMethod { |
This file contains hidden or 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
// while this is not technically a method, a Runnable is close enough for me. | |
// this method wants a "method" as an input | |
void canHazMethod(Runnable methodToRun) { | |
// run the method passed in | |
methodToRun.run(); | |
} | |
// this is the method I will use: | |
Runnable myMethod = () -> { |
This file contains hidden or 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
/// test #1 | |
#define u using | |
#define n namespace | |
#define s std | |
// so can this work? | |
u n s; | |
// yes indeed it can! | |
/// test #2 |
This file contains hidden or 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
/* to make a div round, the width and height must be the same (a square) | |
also, the border radius must be half of the w/h | |
so for a div 42x42, the radius should be 21. */ | |
.my-round-div { | |
background-image: url("my-square-or-round-image.png"); | |
display: block; | |
height: 42px; | |
width: 42px; |
NewerOlder