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
class Hoge | |
private | |
def hoge | |
puts 'hoge' | |
end | |
end | |
class Fuga < Hoge |
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 iterator; | |
import java.util.ArrayList; | |
/** | |
* Userを格納するためのクラス | |
* @author kodaitakahashi | |
* | |
*/ | |
public class UserList { |
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 adapter; | |
public class HTML { | |
private String string; | |
public HTML(String string) { | |
this.string = string; | |
} | |
/** |
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
// method.java | |
class Method{ | |
public void method(long num){ | |
System.out.println("hoge"); | |
} | |
public void method(short num){ | |
System.out.println("huga"); | |
} |
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
// abstractClass.java | |
import java.io.IOException; | |
public abstract class AbstractClass { | |
public abstract void throwIOException() throws IOException; | |
} |
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
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
class Gene<T> implements GenInterface<String>, GenInterface2<Integer> { | |
/* GenInterFaceで指定している型が GenInterface2で継承したときの型と一致している場合はエラーは起きない | |
* しかし、implements時に型が一致してない場合はオーバーライドとして認められない また一度ジェネリックスで指定したあとにもう一度指定はできない | |
* | |
*/ | |
private T val1; |
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
import java.util.Random; | |
import java.util.function.BiFunction; | |
import java.util.function.BinaryOperator; | |
import java.util.function.Consumer; | |
import java.util.function.Function; | |
import java.util.function.IntToDoubleFunction; | |
import java.util.function.Predicate; | |
import java.util.function.Supplier; | |
import java.util.function.ToDoubleFunction; | |
import java.util.function.ToIntFunction; |
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
interface GenInterface<T> { | |
void showState(T t); | |
} | |
interface GenInterface2<T> extends GenInterface<String> { | |
void dispState(T t); | |
} | |
---------------------------------------------------------------- | |
import java.util.ArrayList; |
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
import java.util.HashMap; | |
import java.util.stream.Collectors; | |
import java.util.stream.Stream; | |
public class ME { | |
public static void main(String[] args) { | |
HashMap<Integer, Integer> hashMap = new HashMap<Integer, Integer>(); | |
hashMap.put(1, 100); | |
hashMap.put(2, 200); |
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
import java.util.Arrays; | |
import java.util.Collections; | |
import java.util.List; | |
public class Stream1 { | |
public static void main(String[] args) { | |
List<String> strings = Arrays.asList("b", "a", "d"); | |
for (int i = 0; i < strings.size(); i++) { |