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
// JDK 1.4 style | |
List oldList = new ArrayList(); | |
oldList.add(Integer.valueOf(1)); | |
int oldNumber = ((Integer) oldList.get(0)).intValue(); | |
// JDK 1.5 over | |
List<Integer> newList = new ArrayList<Integer>(); | |
newList.add(1); | |
int modernNumber = newList.get(0); |
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.lang.reflect.Field; | |
public class ReflectionTest { | |
public static void main(String[] args) throws Exception { | |
Mizuno mizuno = new Mizuno(); | |
System.out.println("リフレクション前 : " + mizuno.talk()); // … | |
Class<? extends Mizuno> clazz = mizuno.getClass(); |
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 org.tksmaru.playgound; | |
import java.lang.reflect.Constructor; | |
public class ActiveClassWithReflection { | |
private enum ErrorType { | |
LESS_MONEY("less.money", UserException.class), | |
NO_STOCK("no.stock", ShopException.class), |
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.example.maruyama.helloandroid5; | |
import android.app.Notification; | |
import android.app.NotificationManager; | |
import android.app.PendingIntent; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.graphics.Color; | |
import android.os.Build; | |
import android.support.v7.app.AppCompatActivity; |
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
module.exports = Authentication; | |
// @Constructor | |
function Authentication(name) { | |
this._name = name; | |
}; | |
Authentication.prototype._login = function(loginId, password) { | |
throw new Error("not implemented"); |
OlderNewer