import java.util.ArrayList; import java.util.List; class Patient{ String name; public Patient(String name) { this.name=name; } } public class ArrayList55 { public static void main(String[] args) { List ps=new ArrayList(); Patient p2=new Patient("Mike"); ps.add(p2); // insert code here System.out.println("f="+f); if(f>=0) { System.out.print("Mike Found"); } } } Which code fragment, when inserted ..
public class String60 { public static void main(String[] args) { System.out.println("Result A " + 0 + 1); System.out.println("Result B " + (1) + (2)); } } What is the result? A. Result A 01 Result B 3 B. Result A 1 Result B 12 C. Result A 1 Result B 3 D. Result A 01 Result B 12 정답: D 결과: Result A 01 Result B 12 설명: 앞부분이 문자열이니 뒤에 붙은것들은 문자열으로 보아 + 하면 문자열을 붙인다. 반면에 앞부분이 숫자면 + 기호를 사용하면 덧셈을 한다. 예를들면 ..
public class Static62 { int count; public static void displayMsg() { count++; System.out.println("Welcome "+"Visit Count: "+count); } public static void main(String[] args) { Static62.displayMsg(); Static62.displayMsg(); } } What is the result? A. Compilation fails at line n3 and line n4. B. Compilation fails at line n1 and line n2. C. Welcome Visit Count:1 Welcome Visit Count: 1 D. Welcome Visi..
1. Static 정리 Java에서 Static 키워드를 사용한다는 것은 메모리에 한번 할당되어 프로그램이 종료될 때 해제되는 것을 의미합니다. 이를 정확히 이해하기 위해서는 메모리 영역에 대한 이해가 필요합니다. [ Static의 메모리 ] 일반적으로 우리가 만든 Class는 Static 영역에 생성되고, new 연산을 통해 생성한 객체는 Heap영역에 생성됩니다. 객체의 생성시에 할당된 Heap영역의 메모리는 Garbage Collector를 통해 수시로 관리를 받습니다. 하지만 Static 키워드를 통해 Static 영역에 할당된 메모리는 모든 객체가 공유하는 메모리라는 장점을 지니지만, Garbage Collector의 관리 영역 밖에 존재하므로 Static을 자주 사용하면 프로그램의 종료시까지 ..
- Total
- Today
- Yesterday
- proc
- 이클립스
- Python
- JDBC
- webix
- 오라클
- KG
- esql
- EC
- 인포믹스
- 파싱
- ocajp
- 자바 smtp
- C
- 스크래핑
- php
- XE3
- XE
- 파이썬
- xe애드온
- 문자열
- 포인터
- C언어
- MySQL
- 플러터
- ocjap
- 프로씨
- 라이믹스
- 자바
- xe addon
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
