QUESTION 14자격증/OCJP_ExamB2018. 7. 9. 19:14
Table of Contents
반응형
QUESTION 14
Given:
public class TestOne implements Runnable
{
public static void main (String[] args) throws Exception
{
Thread t = new Thread(new TestOne());
t.start();
System.out.print("Started");
t.join();
System.out.print("Complete");
}
public void run()
{
for (int i = 0; i < 4; i++)
{
System.out.print(i);
}
}
}
What can be a result?
A. Compilation fails.
B. An exception is thrown at runtime.
C. The code executes and prints StartedComplete
D. The code executes and prints StartedComplete0123
E. The code executes and prints Started0123Complete
Solution : E
plus imformation :
void main () --> start() --> run() -->join()
반응형
'자격증 > OCJP_ExamB' 카테고리의 다른 글
QUESTION 16 (0) | 2018.07.09 |
---|---|
QUESTION 15 (0) | 2018.07.09 |
QUESTION 13 (0) | 2018.07.09 |
QUESTION 12 (0) | 2018.07.09 |
QUESTION 11 (0) | 2018.07.09 |
@IT grow. :: IT grow.
#IT #먹방 #전자기기 #일상
#개발 #일상