본문 바로가기

반응형

분류 전체보기

(347)
유효범위 전역변수 지역변수 package org.opentutorials.javatutorials.scope; public class ScopeDemo2 { // 이와 같이 클래스 전체에 걸쳐 영향을 미치는 변수를 전역변수라 한다. static int i; static void a() { // 여기를 int i = 0; 이라고 선언해주면 문제없이 진행된다. // 이 메소드가 실행이 끝나고나면, a()에 할당된 메모리에서 데이터가 삭제되며 // 위의 전역변수 i와는 전혀 다른 뜻이 되기 때문. i = 0; } // 이 경우 i는 전역변수로 설정되어 있기 때문에 // a()는 for문의 매개변수인 i에 의해서 0을 무한반복 출력하게 된다. public static void main(String[] args) { // 여기까지는 i 가..
객체지향의 의의 - 중복없애기 package org.opentutorials.javatutorials.object; public class CalculatorDemo { public static void main(String[] args) { // 아래의 로직이 1000줄 짜리의 복잡한 로직이라고 가정하자. // 상당히 중복이 많다. // 프로그래밍의 기본 원칙 중 하나는 중복을 없애는 것이다. System.out.println(10 + 20); System.out.println(20 + 40); } } package org.opentutorials.javatutorials.object; public class CalculatorDemo2 { // 중복을 없애는 방법으로 메소드를 만드는 방법이 있다. // sum이라는 메소드를 만들고..
Software and art Life without music and arts is dry and meaningless. Arts feel our dry life with meaningful beauty that keeps us alive. People see software engineering to be only functional, but I believe, engineering can also become an art and music, giving us a beautiful and unique perspective about life, as a language can become a poem that gives the happiness. I think arts are all about abstraction and perce..
Computer science and Reality Computer science as a philosophical tool I am an enthusiast for Buddhism and philosophy as I thought them to have some untold truth about life and believed they can solve many problems in a practical way. Plus, this belief was true as I have been applying it to real-world situations including perspectives about life and relationships. As I decided to learn about computer science, I want this sub..
자바 입력과 출력 스캐너 scanner 사용법 package org.opentutorials.javatutorials.io; import java.util.Scanner; // run 하면 ScannerDemo라는 애플리케이션(클래스)가 실행이 되면서 public class ScannerDemo { // 자바가상머신에 의해서 메인이라는 메소드가 호출된다. // 그러나 (String[] args)에 아무런 값도 주지 않았기 때문에 // 현재는 아무런 의미가 없는 상태이다. public static void main(String[] args) { // 인간과 상호작용하기 위한 입력값을 좀 더 유기적으로 받아들이는 방법으로 // 자바 기본 라이브러리 중 하나인 스캐너를 사용해볼 수 있음. // new : 객체 생성 // 사용자가 입력한 값(system.i..
자바 입출력 package org.opentutorials.javatutorials.io; class InputForeachDemo{ // 이 경우 프로그램에 args 인자를 주어야 값을 내놓음. // 따로 입력된 값이 없기 때문 // Run configration을 통해 값을 지정해줘야 입력된 인자에 대한 코드를 실행하여 값을 내놓을 수 있음. public static void main(String[] args){ for(String e : args){ System.out.println(e); } } }
No man is free who cannot command himself I have life's purpose and wishes. Sometimes, I can control myself, and sometimes can't. I think about when I can control myself. There is a word we should remember when we talk about controlling ourselves, there must be easy confidence that I can control myself. You can gain much confidence from small practices: Tidy one's room Following the schedule Planning for the goal to do this you must hav..
이클립스 단축키 정리 이클립스 단축키 정리 (http://blog.daum.net/sualchi/13720369) —– 실행 —– Ctrl + F11 : 이전에 실행했던 클래스 실행 —– 소스 네비게이션 —– Ctrl + 마우스커서(혹은 F3) : 클래스나 메소드 혹은 멤버 상세 검색 Alt + Left, Alt + Right : 이후, 이전 Ctrl + O : 소스의 메소드 리스트 확인 F4 : 클래스명을 선택하고 F4를 누르면 해당 클래스의 상속 계층 확인 Alt + ) : 이전(다음) 작업 화면 —– 문자열 검색 —– Ctrl + K : 찾을 문자열을 블럭으로 지정하고 검색 Ctrl + Shift + K : 밑에서 문자열 검색 Ctrl + J : 입력하면서 검색 Ctrl + Shift + J : 입력하면서 밑에서 검색 ..

반응형