b

switch, if (java 1.6.0_30 본문

language

switch, if (java 1.6.0_30

dev.bistro 2013. 1. 7. 15:12
java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
Compiled from "UseIf.java"
public class UseIf extends java.lang.Object{
public UseIf();
  Code:
   0:	aload_0
   1:	invokespecial	#1; //Method java/lang/Object."":()V
   4:	return

public static void main(java.lang.String[]);
  Code:
   0:	bipush	99
   2:	istore_1
   3:	ldc	#2; //String 
   5:	astore_2
   6:	iload_1
   7:	iconst_1
   8:	if_icmpne	17
   11:	ldc	#3; //String 1
   13:	astore_2
   14:	goto	58
   17:	iload_1
   18:	iconst_2
   19:	if_icmpne	28
   22:	ldc	#4; //String 2
   24:	astore_2
   25:	goto	58
   28:	iload_1
   29:	iconst_3
   30:	if_icmpne	39
   33:	ldc	#5; //String 3
   35:	astore_2
   36:	goto	58
   39:	iload_1
   40:	iconst_4
   41:	if_icmpne	50
   44:	ldc	#6; //String 4
   46:	astore_2
   47:	goto	58
   50:	iload_1
   51:	iconst_5
   52:	if_icmpne	58
   55:	ldc	#7; //String 5
   57:	astore_2
   58:	return

}


Compiled from "UseSwitch.java"
public class UseSwitch extends java.lang.Object{
public UseSwitch();
  Code:
   0:	aload_0
   1:	invokespecial	#1; //Method java/lang/Object."":()V
   4:	return

public static void main(java.lang.String[]);
  Code:
   0:	bipush	99
   2:	istore_1
   3:	ldc	#2; //String 
   5:	astore_2
   6:	iload_1
   7:	tableswitch{ //1 to 5
		1: 40;
		2: 46;
		3: 52;
		4: 58;
		5: 64;
		default: 70 }
   40:	ldc	#3; //String 1
   42:	astore_2
   43:	goto	70
   46:	ldc	#4; //String 2
   48:	astore_2
   49:	goto	70
   52:	ldc	#5; //String 3
   54:	astore_2
   55:	goto	70
   58:	ldc	#6; //String 4
   60:	astore_2
   61:	goto	70
   64:	ldc	#7; //String 5
   66:	astore_2
   67:	goto	70
   70:	return

}



'language' 카테고리의 다른 글

Groovy  (0) 2013.10.25
Comments