QUESTION 42자격증/OCJP_ExamC2018. 7. 26. 06:13
Table of Contents
반응형
QUESTION 42Click the Exhibit button.class Foo {private int x;public Foo( int x ){ this.x = x;}public void setX( int x ) { this.x = x; }public int getX(){ return x;} }public class Gamma {static Foo fooBar(Foo foo) {foo = new Foo(100);return foo;}public static void main(String[] args) {Foo foo = new Foo( 300 );System.out.println( foo.getX() + "-");Foo fooFoo = fooBar(foo);System.out.println(foo.getX() + "-");System.out.println(fooFoo.getX() + "-");foo = fooBar( fooFoo);System.out.println( foo.getX() + "-");System.out.println(fooFoo.getX());}}What is the output of the program shown in the exhibit?A. 300-100-100-100-100B. 300-300-100-100-100C. 300-300-300-100-100D. 300-300-300-300-100Solution : B
반응형
'자격증 > OCJP_ExamC' 카테고리의 다른 글
QUESTION 44 (0) | 2018.07.26 |
---|---|
QUESTION 43 (0) | 2018.07.26 |
QUESTION 41 (0) | 2018.07.26 |
QUESTION 40 (0) | 2018.07.25 |
QUESTION 39 (0) | 2018.07.25 |
@IT grow. :: IT grow.
#IT #먹방 #전자기기 #일상
#개발 #일상