"자바 HashMap.containsKey()"의 두 판 사이의 차이

3번째 줄: 3번째 줄:


<syntaxhighlight lang='java' run>
<syntaxhighlight lang='java' run>
import java.util.HashMap;
public class MyClass {
public class MyClass {
public static void main(String[] args) {
public static void main(String[] args) {

2021년 5월 15일 (토) 12:35 판

1 개요

자바 HashMap .containsKey()
import java.util.HashMap;
public class MyClass {
	public static void main(String[] args) {
		HashMap<String,Object> hm = new HashMap<String,Object>();
		hm.put("first", "1");
		hm.put("second", "4");

		System.out.println( hm.containsKey("first") ); // true
		System.out.println( hm.containsKey("third") ); // false
	}
}

2 같이 보기

3 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}