java(9)
-
자바 달력
자바달력 2월 윤년을 계산해주고 첫번째 날의수 구하고자는 1일이 무슨요일인지 계산해서 뿌려준다. 소스는 아래를 참조 import java.util.*; public class ggari_calendar { static int year = 0; static int month = 0; static int tempNal = 0; static int week = 0; static int i = 0; static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int monthArray[] = {31,28,31,30,31,30,31,31,30,31,30,31}; setYear();//날짜 셋팅 if (year % 4 == ..
2013.08.08 -
자바 소수 반올림
자바 반올림 Math.round 를 써주면 된다 . Math 클래스를 이용하면 올림 내림 버리기가 가능 여러가지가 있으니 참고하자 ex) static long round(double d) Returns the result of rounding the argument to an integer. static int round(float f) Returns the result of rounding the argument to an integer. public class ggari_mahtRound { public static void main(String[] args) { int num = 156; int num1 = 10; double result = (double) (num) / (double) (num1..
2013.08.07 -
윈도우7 자바 환경변수 설정
JDK 와 이클립스 설치를 먼저 합니다 설치를 하지 않았다면 먼저 설치 후 환경변수를 설정해주세요 순서는 상관없지만 참고하시라고요~ JDK 설치 방법 : http://ggari.tistory.com/category/WEB/JSP%28JAVA%29?page=2 이클립스 설치방법 : http://ggari.tistory.com/category/WEB/JSP%28JAVA%29 1. 시스템 환경 변수를 찾아가셔야 합니다 . 아래와 같이 윈도우버튼을 눌르시고 검색을 할수 있습니다 (이방법이 이해가 안가시면 2번부터 보세요~) 2. 1번방법이 안되시면 제어판에 들어가신후 -> 시스템 및 보안 을 클릭해주세요. 3. 고급 시스템 설정을 클릭 해주세요. 4. 시스템 속성이 나타나면서 고급 탭버튼을 눌러주시고 환경변수를..
2013.03.13