Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1 @@
Object.methodName();

View file

@ -0,0 +1 @@
myMethod(97, 3.14)

View file

@ -0,0 +1,7 @@
int myMethod(int a, double b){
// return result of doing sums with a and b
}
int myMethod(int a){
return f(a, 1.414);
}

View file

@ -0,0 +1,2 @@
System.out.println( myMethod( 97, 3.14 ) );
System.out.println( myMethod( 97 ) );

View file

@ -0,0 +1,4 @@
void printAll(String... strings){
for ( String s : strings )
System.out.println( s );
}

View file

@ -0,0 +1,2 @@
printAll( "Freeman" );
printAll( "Freeman", "Hardy", "Willis" );

View file

@ -0,0 +1,5 @@
int myMethod( Map<String,Object> params ){
return
((Integer)params.get("x")).intValue()
+ ((Integer)params.get("y")).intValue();
}

View file

@ -0,0 +1 @@
System.out.println( myMethod(new HashMap<String,Object>(){{put("x",27);put("y",52);}}) );

View file

@ -0,0 +1 @@
int i = myMethod(x);

View file

@ -0,0 +1,3 @@
myMethod(List<String> list){
// If I change the contents of the list here, the caller will see the change
}

View file

@ -0,0 +1 @@
Object.methodName("rosetta", "code");

View file

@ -0,0 +1,3 @@
interface Example {
int add(int valueA, int valueB);
}

View file

@ -0,0 +1,3 @@
int sum(Example example) {
return example.add(1, 2);
}

View file

@ -0,0 +1,2 @@
Example example = (valueA, valueB) -> valueA + valueB;
sum(example);

View file

@ -0,0 +1 @@
String string = Object.methodName("rosetta", "code");

View file

@ -0,0 +1,2 @@
String methodA();
void methodB();

View file

@ -0,0 +1,3 @@
<X, Y, Z> Function<Y, Z> exampleA(BiFunction<X, Y, Z> exampleB, X value) {
return y -> exampleB.apply(value, y);
}

View file

@ -0,0 +1 @@
myMethod()