This commit is contained in:
Ingy döt Net 2013-10-27 22:24:23 +00:00
parent 6f050a029e
commit 776bba907c
3887 changed files with 59894 additions and 7280 deletions

View file

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

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 @@
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);