JAVA 참조형(참조형) 테스트 예시)
impoort java.io.IOException;
public class Ex1 {
public static void main(String() args) throws IOException{
Scanner sc = new Scanner(System.in);
System.out.print("byte 형 정수값 입력");
Byte bt=sc.nextByte(); //-128~127
System.out.println("바이트형의 정수값은: "+bt );
System.out.print("int 형 정수값 입력");
int it=sc.nextInt(); //-2147483648 ~2147483648
System.out.println("int의 정수값은: " +it);
System.out.print("문자(A~Z) / (a~z) 이중에서 입력하세요.");
int oneChar=System.in.read();
System.out.println((char)oneChar);
import java.util.Scanner;
public class Ex2 {
public static void main(String() args) {
Scanner sc=new Scanner(System.in);
boolean boolA;
int x,y;
System.out.print("첫번째 정수 입력: ");
x=sc.nextInt();
System.out.printf("x 값은: %d\n",x);
System.out.print("두번째 정수 입력 : ");
y=sc.nextInt();
System.out.printf("y 값은 : %d\n",y);
boolA=x > y;
System.out.printf("결과는 %d > %d = %b\n",x,y,boolA);
System.out.printf("더하기 결과는 %d + %d = %d\n" x,y,x+y);