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 InnerClassExample { | |
public static void main(String[] args) { | |
System.out.println("Hello World"); | |
OuterClass outer_class = new OuterClass(); | |
outer_class.outer_method(); | |
OuterClass.InnerClass inner_class = outer_class.new InnerClass(); | |
inner_class.inner_method(); | |
// 匿名クラス | |
new OuterClass() { |
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.concurrent.CompletableFuture; | |
import java.util.concurrent.ExexutorService; | |
import java.util.concurrent.Exevutors; | |
class CompletableFutureExample { | |
public static void main(String[] args) throws Exception { | |
CompletableFuture<String> future1 = CompletableFuture.supplyAsync( | |
() -> { | |
try { |
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
// Gistの確認 | |
import java.util.Comparator; | |
class test_1 { | |
public static void main(String[] args) { | |
Comparator<String> c = (s1, s2) -> s1.compareTo(s2); | |
System.out.println(c.compare("aaa", "bbb")); | |
} | |
} |
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 com.wheeliechamp.myapplication3 | |
import android.content.Context | |
import android.support.v7.app.AppCompatActivity | |
import android.os.Bundle | |
import android.util.Log | |
import android.view.View | |
import android.webkit.* | |
import android.widget.TextView | |
import kotlinx.coroutines.CoroutineScope |
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 com.wheeliechamp.myapplication3 | |
import android.R.attr.contextClickable | |
import android.content.Context | |
import android.support.v7.app.AppCompatActivity | |
import android.os.Bundle | |
import android.os.Handler | |
import android.util.Log | |
import android.view.View | |
import android.webkit.* |
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.*; | |
import java.util.Set; | |
import java.util.HashSet; | |
public class Main { | |
public static void main(String[] args) throws Exception { | |
// Your code here! | |
String[] str = {"aaa", "bbb", "ccc", "bbb"}; | |
Set<String> aaa = new HashSet<String>(); | |
for(int i=0; i < str.length; i++) { |
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
public class Main { | |
public static void main(String args[]){ | |
System.out.println(isArgsEmpty("AAA", "BBB", "CCC", "")); | |
} | |
private static boolean isArgsEmpty(String... args){ | |
//Predicate<String> javaChecker = s -> { return s.equals("Java"); }; | |
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
public class Main { | |
public static void main(String[] args) throws Exception { | |
Object objval = 111; | |
System.out.println(objval instanceof Integer); | |
System.out.println(objval instanceof String); | |
System.out.println((int)objval); | |
System.out.println("XXXXXXXX"); | |
} | |
} |
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
fun main(args: Array<String>) { | |
val names = arrayOf("111", "222", "333", "444", "555", "666", "777", "888", "999", "000") | |
for (str in names){ | |
System.out.println(str) | |
} | |
} |
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
https://qiita.com/sass9872/items/18244ff81a9efcfcd251 | |
val text1 = "aaaTEST" | |
val text2 = "TESTaaa" | |
result = text1.startsWith("TEST") | |
// -> false | |
result = text2.startsWith("TEST") | |
// -> true |