Programming/Java2014. 3. 17. 20:11
JDK 1.5.0부터 추가된 import static은
c++의 using namespace와 같은 역할을 한다.

아래의 문장이
double r = Math.cos(Math.PI * theta); 
 
이렇게 축약될 수 있다.
import static java.lang.Math.PI;
import static java.lang.Math.*;
double r = cos(PI * theta); 


타이핑이 줄어서 편할수도 있지만 
물론 이렇게 name space를 파괴하면서 다른 패키지와의 충돌이나
가독성(System.out.println이 워낙 익숙한데 out.println이라고 쳐놓으면.. )의 문제로
그리 많이 쓰이진 않는 듯 하다. 

[링크 : http://docs.oracle.com/javase/1.5.0/docs/guide/language/static-import.html]

'Programming > Java' 카테고리의 다른 글

java collection  (0) 2014.03.18
java generic  (0) 2014.03.18
java inner class / anonymous class  (0) 2014.03.17
java private constructor  (0) 2014.03.14
java abstract / interface & cpp virtual  (0) 2014.03.14
Posted by 구차니
Programming/web 관련2014. 3. 17. 19:53
HTML / CSS 등에 대해서 잘 번역되어 있는 사이트

[링크 : http://trio.co.kr/]

'Programming > web 관련' 카테고리의 다른 글

ie8 과 크롬의 html 태그 파싱 차이점  (0) 2014.04.10
NoSQL  (0) 2014.04.09
wan 에서 mac address 얻기  (0) 2013.07.09
축약주소 만들기 서비스  (0) 2013.07.08
php-mobile-detect  (0) 2013.02.23
Posted by 구차니
Programming/Java2014. 3. 17. 19:49
inner class는
class 안에 class를 생성하여
클래스 안에서만 사용하도록 하는 일종의 임시 객체이다. 

inner class
  - staic inner class
method class
anonymous class

inner Class의 제약사항
변수 중에 static이 하나라도 있으면 static class가 되어야 함

method 안에서 선언할 경우 Local Class라 하며,
static 멤버 변수가 선언될 수 없으며 또한, static Local Class가 될 수 없다.

outer.this.var 식으로 inner 클래스의 외부 클래스 변수에 접속할 수 있다.

inner class에서 static 변수에는 (외부 클래스의) static 변수만이 할당가능하다.

public class InnerEx2 {

class InstanceInner {
}

static class StaticInner {
}

InstanceInner iv = new InstanceInner();
static StaticInner cv = new StaticInner();

static void staticMethod()
{
StaticInner obj2 = new StaticInner();

// InstanceInner obj1 = new InstanceInner();
InnerEx2 outer = new InnerEx2();
InstanceInner obj1 = outer.new InstanceInner();
}
} 
내부 클래스에서 다른 내부 클래스를 선언시
외부 클래스.new 내부 클래스(); 식으로 선언할 수 있다.

void myMethod()
{
int lv = 0;
final int LV = 0;

class LocalInner {
int liv = outerIv;
int liv2 = outerCv;
// int liv3 = lv; <<
int liv4 = LV;
}
}
method내의 Local Class에서는 메소드 내의 변수를 사용할 수 없다.
(메소드가 메모리에 올라가서 구획이 생성되기 전이기에)

Object iv = new Object() {void method() {}};
anonymous class 에서의 메소드 정의

public static void main(String[] args)
{
// TODO Auto-generated method stub
Button b = new Button("Start");
b.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
System.out.println("ActionEvent occurred!!!");
}
});
} 

instanceof
객체 instanceof class 식으로 사용하며, 상속관계에 있을 경우
해당 객체가 상위 객체를 포함하므로 instanceof에서 true가 되지만
상위 객체를 하위 객체로instanceof 할 경우 false가 된다.

'Programming > Java' 카테고리의 다른 글

java generic  (0) 2014.03.18
java static import  (0) 2014.03.17
java private constructor  (0) 2014.03.14
java abstract / interface & cpp virtual  (0) 2014.03.14
Java / cpp - 다형성(polymorphism) 차이점 (동적 바인딩?)  (0) 2014.03.13
Posted by 구차니
프로그램 사용/autocad2014. 3. 17. 14:20

'프로그램 사용 > autocad' 카테고리의 다른 글

원 채우기  (0) 2018.05.01
캐드 명령어 이것저것  (0) 2018.01.09
autocad 명령어  (0) 2018.01.08
AutoCad 2011 도움말 - 명령어  (0) 2014.01.17
Autocad 학원 수강 3일차  (0) 2014.01.17
Posted by 구차니
한번 떨어지고 이번에는 합격!!
1급보고 붙으면 1급 발급받을까나
2급 발급도 2만원이라 ㅠㅠ

아무튼 1급은 바로신청할까 어쩔까 고민되네 ㅠㅠ


'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글

직장은 소식이 없고..  (0) 2014.07.20
지갑도 가벼워지고...  (0) 2014.04.17
끄아아 내 6만원 ㅠㅠ 아니 12만원?  (0) 2014.03.03
솔데스크 C언어 통합 1일차  (0) 2014.02.24
ATC 2급 시험  (0) 2014.02.22
Posted by 구차니
wine의 안드로이드 포팅같긴한데..
지하철에서 핸드폰으로 스타를 하길래 먼가하고 찾아봤더니
wine과 유사하지만 포팅은 아니라고 한다.
Q: What is Winulator?

A: Winulator is an Android app that provides a run-time platform for Windows programs. It is similar in a sense to Wine, how it is not a port of Wine. It is currently under development.

[링크 : http://docs.winulator.com/faq

일단 시저 3만 정식 지원이고
스타크래프트 : 브루드워는 패치로 이제 베타 지원중이라고 한다.
 The following is a list of programs and games that are tested on the Winulator platform. For each page there are detailed instructions on how to set it up.

WORK IN PROGRESS:

[링크 : http://docs.winulator.com/programs]

[링크 : http://www.winulator.com/]



Posted by 구차니
게임2014. 3. 15. 23:35
예전에 험블로 산건데
은근히 재미있다.

그런데.. 어렵다!!!
역시 인간이란 -_-
탐욕의 동물이라 좀 발전한다 싶으면 전쟁걸고!!! 

 

'게임' 카테고리의 다른 글

Need for Speed hot pursuit 트리플 모니터  (0) 2014.06.06
JASF 만세? ㅋㅋ  (0) 2014.06.04
HOARD 재미있네?  (0) 2014.03.09
bio shock 시리즈 한글 패치  (0) 2014.03.08
피망 블레스  (0) 2014.02.12
Posted by 구차니
Programming/C++ STL2014. 3. 15. 17:04
struct에서 변수값 주던가?
즉, class 역시 struct로 구현되기에 class 에 실제 값을 넣어줄 수 없다.

cpp는 c의 확장형이기에
멀 하던 c를 잊을수가 없네 ㅠㅠ 

아무튼 이렇기에
cpp class는 생성자에서 값을 초기화 하고
const형의 경우에는 member initialize list를 통해서 초기화 해주도록 한다. 

'Programming > C++ STL' 카테고리의 다른 글

cpp static 변수 및 메소드  (0) 2014.03.18
cpp scope 연산자  (0) 2014.03.18
cpp 와 java의 차이점(문법)  (0) 2014.03.14
cpp 디폴트 매개변수  (0) 2014.03.12
c -> cpp 추가사항  (0) 2014.03.10
Posted by 구차니
Programming/Java2014. 3. 14. 21:11
class를 객체로 생성하지 못하도록 막는게 private 생성자이다.
어떻게 보면 객체를 생성하지 못하게 하나 싶긴한데...
static method들로 도배되어 굳이 생성될 필요가 없는 클래스라면 아예 객체 생성을 막는 것도 방법이긴 하니까..

 The declaration of the empty constructor prevents the automatic generation of a default constructor. Note that if you do not use an access modifier with the constructor it will still be private by default. However, the privatemodifier is usually used explicitly to make it clear that the class cannot be instantiated.
 

[링크 : http://msdn.microsoft.com/en-us/library/kcfb85a6.aspx
Posted by 구차니
개소리 왈왈/컴퓨터2014. 3. 14. 18:39
개인서버이니 다운로드 필요하면 확인 필요.

[링크 : http://cafe.naver.com/umid/16100]
    [링크 : http://djj.iptime.org:81/download/Mbook/]

'개소리 왈왈 > 컴퓨터' 카테고리의 다른 글

엠북 180도 펼치기 개조  (0) 2014.03.26
umid mbook m1 배터리 교체  (2) 2014.03.19
umid mbook m1 lcd 구매 + 분해기  (0) 2014.03.12
생일선물? ㅋㅋ  (2) 2014.02.01
DVD+R DL로 구운 뒷면  (0) 2014.01.30
Posted by 구차니