Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Wednesday, June 7, 2017

Install JDK on Windows (+ Environment Variables setting)

JDK - Java Development Kit


1. Download JDK
- Go to www.oracle.com, select [Download] - [Java SE]

2. Check JDK version and click 'download'

3. Select "Accept License Agreement" and download "jdk-****-windows-x**.exe"

4. Execute *.exe file and click "Next"

5. Select option and installing path
- select all, without any special reason
- remember installing path, it need to setting environment variable
- click Next

6. JRE is installed automatically just click "Next"

7. Setting Environment Variable


** Setting Environment Variable
1. Click on "Advanced" tab on "System Properties"

2. Click on "Environment Variables" button

3. Create a new class path for JAVA_HOME (system variables)
- set Variable name as JAVA_HOME and value as c:\Programfiles\Java\jdk-*.*\bin

4. Modify "Path" in "System Variables"
- add ;%JAVA_HOME%\bin;
- Do not miss semicolon

5. Execute cmd and check installing completly
- type in "java -version" and "javac -version"


ref : http://recipes4dev.tistory.com/50#23-java-%EC%8B%A4%ED%96%89-%ED%99%98%EA%B2%BD-%EB%B3%80%EC%88%98-%EC%84%A4%EC%A0%95

Monday, July 25, 2016

3, 6, 9 게임 - Java (korean)

임의의 양의 정수를 정하고 그 수까지 3, 6, 9 게임을 수행

* 해당 숫자에서 3, 6, 9를 포함하고 있는 개수만큼 박수를 침


import java.util.ArrayList;
import java.util.List;

public class dateTest1 {
    public static void main(String[] args) {
        int a = 372;
        List  tsn = new ArrayList();
        tsn.add(3);
        tsn.add(6);
        tsn.add(9);
        boolean clap = false;
        for(int i=1 ; i<=a ; i++) {
            int temp = i;
            while(temp > 0) {
                if(tsn.contains(temp%10)){
                    System.out.print("짝!");
                    clap = true;
                }
                temp = temp/10;
            }
         if(clap) {
              System.out.println();
              clap = false;
              continue;
         } else   
             System.out.println(i);
        }
    }
}