posted by 셀로브 2020. 6. 10. 09:05

(at the immigration office) What's the purpose of your visit?
(입국 심사대에서) 방문 목적이 뭔가요?
immigration office : 입국 심사대
purpose : 목적

To traval.
여행 왔습니다.

How long are you travaling in Sweden?
스웨덴에서 얼마나 여행하실 건가요?

For 10 days.
10일 동안이요.
주어 동사 없이 핵심만 말해서 대화 가능하다.

For 10 days only in Sweden?
10일 동안 스웨덴에만 계실 건가요?


Yes.


Alright. Where will you be staying?
알겠습니다. 어디에서 묵으실건가요?

I have a reservation at ABC hotel.
ABC 호텔을 예약했습니다.

Do you have a return ticket?
귀국편 비행기표를 가지고 계신가요?
return ticket : 귀국 티켓

Sure, I do. Here is a copy of my itineraty.
그럼요, 있어요. 여기 제 일정표 사본이 있는데요.
a copy of ~ : ~ 사본

Oh, no... Where's it gone?
아, 이런... 어디 갔지?

참조출처 : 네이버 오늘의 회화

'언어(Language) > 영어(English)' 카테고리의 다른 글

Do you have a good appetite?  (0) 2020.06.09
When's the last time you got a checkup?  (0) 2020.06.09
posted by 셀로브 2020. 6. 9. 14:01

Have you lost or gained weight recently?

요즘 체중이 줄거나 늘었나요?

  • Have you p.p? ~하셨나요?
  • lost가 last로 들림.
  • gained가 gain까지만 들림.
  • recently 가 리센라이로 들림.

 

Not really.

별로요.

 

My weight has been the same for the last five years.

지난 5년간 체중이 똑같았어요.

 

How's your appitite?

입맛은 어떠세요?

  • appitite : 입맛. 식욕

 

Do you have a good apptitle?

식욕은 좋으신가요?

 

It's the same as usual.

평소랑 같아요.

  • as usual. 늘 그렇듯이. 평소

 

Oh, come to think of it. I've had lots a fatty food at night.

아, 그러고 보니, 밤에 기름진 음식을 많이 먹었네요.

  • Oh, come to think of it, ~. 아, 그러고 보니, ~예요.
  • fatty : 기름진
  • I'v had food : 음식을 많이 먹었네요.

 

I see. Now please get on the table.

  • 알겠습니다. 이제 진료대로 올라가세요.

참고출처 : 네이버 오늘의 영어회화

'언어(Language) > 영어(English)' 카테고리의 다른 글

Here is a copy of my itinerary.  (0) 2020.06.10
When's the last time you got a checkup?  (0) 2020.06.09
posted by 셀로브 2020. 6. 9. 13:40

When's the last time you got a checkup.

마지막으로 건강 검진을 받으신게 언제죠?

  • When's(When + is) : 웬즈로 발음
  • last : 래스트로 발음
  • check up이 아닌 checkup. 뜻은 검진

 

Last year. In May.

작년이요. 5월에요.

 

Okay. Lie on your back.

그렇군요. 누워 보세요.

  • Lie : 눕다.
  • bag으로 들림. Lie를 보고 back으로 파악 필요. back : 등

 

Please tell me if it hurts.

아프시면 말씀하세요.

  • if it은 이프 잇이 아닌 이핏으로 발음된다.
  • hurts가 hearts로 들린다.

 

Alright.

네.

 

Now lie on your stomach.

이제 엎드려 보세요.

  • Now가 No로 들린다.
  • Stomach 배.
  • 정리하면 lie on your back은 등을 대고 눞는 것, lie on your stomach은 배를 대고 눞는 것

 

Does it hurt if I press heare like this?

여기를 이렇게 누르면 아프세요?

  • Does it은 더즈 잇 이 아닌 더짓으로 발음됨을 주의

 

Yes, a little.

네, 약간이요.

 

Can you sit up for a second?

잠시 앉아 보시겠어요?

  • sit down (서있는 상태에서) 앉다.
  • sit up (누워있는 상태에서) 앉다. 일어나 앉다.

 

Okay. Now you can get off the table.

됐습니다. 이제 진료대에서 내려오셔도 됩니다.

  • get off : 내려오다.
  • table : 진료대

 

참고출처 : 네이버 오늘의 영어회화

 

 

'언어(Language) > 영어(English)' 카테고리의 다른 글

Here is a copy of my itinerary.  (0) 2020.06.10
Do you have a good appetite?  (0) 2020.06.09
posted by 셀로브 2013. 12. 19. 21:56


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66

No enclosing instance of type 클래스이름 is accessible. Must qualify the 
allocation with an enclosing instance of type 클래스이름 (e.g. x.new A() where 
        x is an instance of 클래스이름)

접근하려는 클래스의 인스턴스가 닫혀져 있지 않다는 뜻인듯합니다.

검색해보니 static 인지 확인하라고 되어 있군요.

참고 : http://www.ezslookingaround.com/blog/tech/?no=1265

    static 메서드 안에 비스테틱 local class를 선언해서 사용하는 경우 발생합니다.
    public class A {
    class B {
    }

    public static String getString(){
        B b = new B();                      //여기서 컴파일 에러가 발생합니다.
    }
}

non-static 클래스는 포함하고있는 상위 클래스를 인스턴스로 생성한다음 그 인스턴스를 통해서 생성할수 있는데 , 
해당 메서드에서는 포함하고 있는 A클래스의 인스턴스를 생성하지 않고  B클래스만 생성하려고 하기 때문입니다.
public class A {
    static class B {
    }

    public static String getString(){
        B b = new B();                      //이제는 별말 안합니다.
    }
}

차라리 public class로 따로 만들어도 됩니다.
//A.java
public class A {
    public static String getString(){
        B b = new B();                      //이래도 별말 안합니다..
    }
}
-----------------------------
//B.java
public class B {

}

그냥 로컬에서만 빼도 됩니다.
//A.java
public class A {
    public static String getString(){
        B b = new B();                      //이래도 별말 안합니다..
    }
}

class B {

}

그리고 둘다 static 을 지워도 됩니다.
public class A {
    class B {
    }

    public String getString(){
        B b = new B();                      //이경우도 별말 안합니다.
    }
}


'언어(Language) > JAVA' 카테고리의 다른 글

Java 한글 <-> 유니코드 변환  (0) 2013.12.19
Text File Read Write  (0) 2013.12.18
IS-A 관계와 HAS-A 관계  (0) 2013.10.20
캡슐화  (0) 2013.10.20
다형성  (0) 2013.10.20
posted by 셀로브 2013. 12. 19. 21:34


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
public class Unicode {

    public static String decode(String unicode)throws Exception {
        StringBuffer str = new StringBuffer();

        char ch = 0;
        forint i= unicode.indexOf("\\u"); i > -1; i = unicode.indexOf("\\u") ){
            ch = (char)Integer.parseInt( unicode.substring( i + 2, i + 6 ) ,16);
            str.append( unicode.substring(0, i) );
            str.append( String.valueOf(ch) );
            unicode = unicode.substring(i + 6);
        }
        str.append( unicode );

        return str.toString();
    }

    public static String encode(String unicode)throws Exception {
        StringBuffer str = new StringBuffer();

        for (int i = 0; i < unicode.length(); i++) {
            if(((int) unicode.charAt(i) == 32)) {
                str.append(" ");
                continue;
            }
            str.append("\\u");
            str.append(Integer.toHexString((int) unicode.charAt(i)));

        }

        return str.toString();

    }

    public static void main(String[] args) throws Exception {
        String str = encode("한 글");
        System.out.println(str);
        System.out.println(decode(str));
    }
}


'언어(Language) > JAVA' 카테고리의 다른 글

No enclosing instance of type 컴파일 오류  (0) 2013.12.19
Text File Read Write  (0) 2013.12.18
IS-A 관계와 HAS-A 관계  (0) 2013.10.20
캡슐화  (0) 2013.10.20
다형성  (0) 2013.10.20
posted by 셀로브 2013. 12. 18. 19:12

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import java.io.*;

public class ReadWriteTextFile {

    static public String getContents(File aFile) {
        //...checks on aFile are elided
        StringBuilder contents = new StringBuilder();

        try {
            //use buffering, reading one line at a time
            //FileReader always assumes default encoding is OK!
            BufferedReader input =  new BufferedReader(new FileReader(aFile));
            try {
                String line = null; //not declared within while loop
                /*
                 * readLine is a bit quirky :
                 * it returns the content of a line MINUS the newline.
                 * it returns null only for the END of the stream.
                 * it returns an empty String if two newlines appear in a row.
                 */

                while (( line = input.readLine()) != null){
                    contents.append(line);
                    contents.append(System.getProperty("line.separator"));
                }
            }
            finally {
                input.close();
            }
        }
        catch (IOException ex){
            ex.printStackTrace();
        }


        return contents.toString();
    }

    static public void setContents(File aFile, String aContents)
            throws FileNotFoundException, IOException {
        if (aFile == null) {
            throw new IllegalArgumentException("File should not be null.");
        }
        if (!aFile.exists()) {
            throw new FileNotFoundException ("File does not exist: " + aFile);
        }
        if (!aFile.isFile()) {
            throw new IllegalArgumentException("Should not be a directory: " + aFile);
        }
        if (!aFile.canWrite()) {
            throw new IllegalArgumentException("File cannot be written: " + aFile);
        }

        //use buffering
        Writer output = new BufferedWriter(new FileWriter(aFile));
        try {
            //FileWriter always assumes default encoding is OK!
            output.write( aContents );
        }
        finally {
            output.close();
        }
    }

    public static void main (String... aArguments) throws IOException {
        File testFile = new File("C:\\PageCount.txt");
        System.out.println("Original file contents: " + getContents(testFile));
        setContents(testFile, "The content of this file has been overwritten...");
        System.out.println("New file contents: " + getContents(testFile));
    }
}


'언어(Language) > JAVA' 카테고리의 다른 글

No enclosing instance of type 컴파일 오류  (0) 2013.12.19
Java 한글 <-> 유니코드 변환  (0) 2013.12.19
IS-A 관계와 HAS-A 관계  (0) 2013.10.20
캡슐화  (0) 2013.10.20
다형성  (0) 2013.10.20
posted by 셀로브 2013. 10. 20. 04:46

상속관계 중 IS-A관계와 HAS-A관계가 있다.


말 그대로 IS-A관계는 "~는 ~이다."가 성립되는 관계이고, HAS-A관계는 "~는 ~이다."가 성립되는 관계이다.


다음 상속관계를 살펴보자.

public class Human{

String name; // 이름

int age; // 나이

int sex; // 성별

}

public class Studentextends Human{

int number; // 학번

int major; // 전공

}


위의 상속 관계에서는 학생클래스가 사람클래스를 상속받고 있다.

"학생은 사람이다". 이러한 관계를 위처럼 표현했을 때 IS-A관계 라고 한다.


이어서 다음 상속관계를 살펴보자.

public class Gun{

String name; // 총 이름

int shot; // 총알 수

}

public class Police{

Gun gun; // 멤버객체로 총을 갖는다.

}



위와 같이 "경찰은 총을 가진다."의 구조로 경찰클래스안에 권총클래스의 객체를 멤버로 가지고 있는 경우를 HAS-A 관계라고 한다.

'언어(Language) > JAVA' 카테고리의 다른 글

Java 한글 <-> 유니코드 변환  (0) 2013.12.19
Text File Read Write  (0) 2013.12.18
캡슐화  (0) 2013.10.20
다형성  (0) 2013.10.20
상속  (0) 2013.10.20
posted by 셀로브 2013. 10. 20. 03:47

캡슐화는 중요한 정보를 은닉하여 보호할 수 있도록 구성하는 것입니다. 


가장 간단한 형태의 캡슐화는 다음과 같습니다.

public class Airplane{

private int speed;    // 접근지정자를 private로 지정

public void setSpeed(int speed){

this.speed = speed * 1000;

}

public int getSpeed(){

return speed;

}

}


public class test{

public static void main(String[] args){

Airplane jet = new Airplane();

jet.setSpeed(227);

speed = 227;    // error : 정상적이지 않은 접근을 막아 오류를 막을 수 있습니다.

}

}


즉, 이처럼 올바르지 않은 접근으로부터 자원을 보호할 수 있습니다.

캡슐화를 통해 코드의 부분을 나머지 부분으로부터 분리할 수 있습니다.


'언어(Language) > JAVA' 카테고리의 다른 글

Java 한글 <-> 유니코드 변환  (0) 2013.12.19
Text File Read Write  (0) 2013.12.18
IS-A 관계와 HAS-A 관계  (0) 2013.10.20
다형성  (0) 2013.10.20
상속  (0) 2013.10.20
posted by 셀로브 2013. 10. 20. 03:26

부모클래스 Animal에 자식클래스 Dog, Cat, Duck이 있다.



자식클래스들은 각각 부모클래스의 Speek()함수를 재정의 하고고 있다.

재정의 한 내용은 다음과 같다고 가정하자.


Dog

public void Speek(){

    System.out.println("멍멍 ");

}


Cat

public void Speek(){

    System.out.println("야옹 ");

}


Duck

public void Speek(){

    System.out.println("꽥꽥 ");

}


Dog, Cat, Duck은 Animal의 자식클래스 이므로 다음과 같은 객체생성이 가능하다.


Animal dog = new Dog();

Animal cat = new Cat();

Animal duck = new Duck();


그리고 다음과 같이 함수를 호출해보자.
dog.speek();
cat.speek();
duck.speek();


각각의 자식클래스는 재정의한 speek함수의 동작을 수행하게 된다.


실행결과

 멍멍 야옹 꽥꽥


이처럼 다형성을 활용하면 서로 다른 서브클래스의 객체가 동일한 함수호출로 다른 응답을 하도록 구성할 수 있다.


'언어(Language) > JAVA' 카테고리의 다른 글

Java 한글 <-> 유니코드 변환  (0) 2013.12.19
Text File Read Write  (0) 2013.12.18
IS-A 관계와 HAS-A 관계  (0) 2013.10.20
캡슐화  (0) 2013.10.20
상속  (0) 2013.10.20
posted by 셀로브 2013. 10. 20. 02:37

상속은 중복되는 코드를 피할 수 있는 장점이 있습니다. 하지만 많은 경우 의존도가 높아지는 단점이 있습니다. 다음은 상속의 기본 구조입니다.


부모클래스(Super Class)

public class Airplane{

private int speed;


public Airplane(){

}

public int getSpeed(){

return speed;

}

public void setSpeed(int speed){

this.speed = speed;

}

}


자식클래스(Sub Class)

public class Jet extends Airplane{

private static final int MULTIPLIER = 2;


public Jet(){

super();    // 수퍼클래스(부모클래스)의 생성자를 호출 합니다.

}

public void setSpeed(int speed){    // 함수 오버라이딩 (부모클래스의 멤버함수를 재정의)

super.setSpeed(speed * MULTIPLIER);

}

public void accelerate(){

super.setSpeed(getSpeed() * 2);

}

}


위 상속을 UML로 표현하면 다음과 같습니다.



더 공부하기

캡슐화

다형성

IS-A관계와 HAS-A관계


'언어(Language) > JAVA' 카테고리의 다른 글

Java 한글 <-> 유니코드 변환  (0) 2013.12.19
Text File Read Write  (0) 2013.12.18
IS-A 관계와 HAS-A 관계  (0) 2013.10.20
캡슐화  (0) 2013.10.20
다형성  (0) 2013.10.20