Development/Java(855)
-
FunctionEx03-값을 반환하는 메소드
값을 반환하는 메소드 학습내용 값을 반환하는 메소드 값을 반화하지 않는 메소드 소스코드 public class FunctionEx03 { public static void main(String[] args) { int result=plus(3, 7); System.out.println("3와 7의 합: " + result); System.out.println("3.5의 제곱: " + square(3.5)); } //int형 데이터 반환 public static int plus(int num1, int num2) { int plusResult=num1+num2; return plusResult; } //double형 데이터 반환 public static double square(double num) { r..
-
FunctionEx02-메소드의 매개변수
메소드의 매개변수 학습내용 두개의 매개변수를 호출하는 함수 정의 및 호출 매개변수가 없는 함수 정의 및 호출 소스코드 public class FunctionEx02 { public static void main(String[] args) { System.out.println("프로그램의 시작"); int minute = 30; //메소드 실행(호출) tellTime(9, 11); tellTime(18, 30); tellTime(20, minute); //변수를 통한 메소드 호출 byEveryone(); System.out.println("프로그램의 끝"); } //매개변수는 전달 순서대로 저장 //hour = 9, minute = 11 public static void tellTime(int hour, ..
-
FunctionEx01-함수 구조 이해
함수 구조 이해 학습 내용 함수 구조 이해 메소드 정의 메소드 호출/재호출 매개변수 선언 프로그램 흐름 소스코드 public class FunctionEx01 { public static void main(String[] args) { System.out.println("프로그램의 시작"); //메소드 실행(호출) tellTime(9); tellTime(18); //정의한 메소드는 얼마든지 재호출 가능 System.out.println("프로그램의 끝"); } //int time : 매개변수 //매개변수: 매소드 실행시 전달되는 값을 저장하기 위해 선언된 변수 //메소드 정의 public static void tellTime(int hour) { System.out.println("즐거운 하루입니다.")..
-
printf( ) 사용시 컴파일 Error- Exception in thread "main" java.lang.Error: Unresolved compilation problem: The method printf(String, Object[]) in the type PrintStream is not applicable for the arguments (String, int, float, char, String) - Eclipse..
오류 메시지 Exception in thread "main" java.lang.Error: Unresolved compilation problem: The method printf(String, Object[]) in the type PrintStream is not applicable for the arguments (String, int, float, char, String) 해결방법1 - 이클립스의 컴파일 버전 변경으로 해결 eclipse > windows > preference > Java-Compiler > Java-Compiler에서 Compiler compliance level:1.4을 1.7로 변경 변경 전 변경 후 해결방법2 - 프로젝트의 자바 컴파일 버전 변경 프로젝트 선택 > 마우스 ..
-
Error-Access restriction: The constructor JFrame(String) is not accessible due to restriction on required library C:\Program Files\Java\jdk1.8.0_05\jre\lib\rt.jar
오류메시지 Access restriction: The constructor JFrame(String) is not accessible due to restriction on required library C:\Program Files\Java\jdk1.8.0_05\jre\lib\rt.jar 해결방법 이클립스 메뉴 > Window > Preferences Java > Compiler > Errors/Warnings > 굵은 글씨체로 되어있는 Deprecated and restriced API 라는 메뉴 확장 Forbidden reference (access rules): 에서 Error에서 Warning으로 변경 후 Apply > OK
-
운영체제 OS의 비트버전 확인 - Windows 7, Vista, Windows8 비트수(bit)
Windows 7, Vista, 8 윈도우 탐색기에서 내컴퓨터/내PC선택 > 마우스 우클릭 > 속성 또는 단축키(Windows + Pause)로 시스템 정보 창 오픈 시스템의 시스템종류에서 비트 확인