자바 튜토리얼

자바 홈 자바 소개 자바 시작하기 자바 구문 자바 주석 자바 변수 자바 데이터 유형 자바 타입 캐스팅 자바 연산자 자바 문자열 자바 수학 자바 부울 자바 If...Else 자바 스위치 자바 while 루프 자바 For 루프 자바 중단/계속 자바 배열

자바 메소드

자바 메소드 자바 메소드 매개변수 자바 메소드 오버로딩 자바 범위 자바 재귀

자바 클래스

자바 OOP 자바 클래스/객체 자바 클래스 속성 자바 클래스 메소드 자바 생성자 자바 수정자 자바 캡슐화 자바 패키지 / API 자바 상속 자바 다형성 자바 내부 클래스 자바 추상화 자바 인터페이스 자바 열거형 자바 사용자 입력 자바 날짜 자바 배열 목록 자바 링크드리스트 자바 해시맵 자바 해시셋 자바 반복자 자바 래퍼 클래스 자바 예외 자바 정규식 자바 스레드 자바 람다

자바 파일 처리

자바 파일 자바 파일 생성/쓰기 자바 읽기 파일 자바 삭제 파일

자바 방법

두 개의 숫자 더하기

자바 참조

자바 키워드 자바 문자열 메소드 자바 수학 메소드

자바 예제

자바 예제 자바 컴파일러 자바 연습 자바 퀴즈 자바 인증서


자바 키워드


자바 예약어

Java에는 변수, 메소드, 클래스 또는 기타 식별자로 사용할 수 없는 예약어인 키워드 세트가 있습니다.

Keyword Description
abstract A non-access modifier. Used for classes and methods: An abstract class cannot be used to create objects (to access it, it must be inherited from another class). An abstract method can only be used in an abstract class, and it does not have a body. The body is provided by the subclass (inherited from)
assert For debugging
boolean A data type that can only store true and false values
break Breaks out of a loop or a switch block
byte A data type that can store whole numbers from -128 and 127
case Marks a block of code in switch statements
catch Catches exceptions generated by try statements
char A data type that is used to store a single character
class Defines a class
continue Continues to the next iteration of a loop
const Defines a constant. Not in use - use final instead
default Specifies the default block of code in a switch statement
do Used together with while to create a do-while loop
double A data type that can store whole numbers from 1.7e−308 to 1.7e+308
else Used in conditional statements
enum Declares an enumerated (unchangeable) type
exports Exports a package with a module. New in Java 9
extends Extends a class (indicates that a class is inherited from another class)
final A non-access modifier used for classes, attributes and methods, which makes them non-changeable (impossible to inherit or override)
finally Used with exceptions, a block of code that will be executed no matter if there is an exception or not
float A data type that can store whole numbers from 3.4e−038 to 3.4e+038
for Create a for loop
goto Not in use, and has no function
if Makes a conditional statement
implements Implements an interface
import Used to import a package, class or interface
instanceof Checks whether an object is an instance of a specific class or an interface
int A data type that can store whole numbers from -2147483648 to 2147483647
interface Used to declare a special type of class that only contains abstract methods
long A data type that can store whole numbers from -9223372036854775808 to 9223372036854775808
module Declares a module. New in Java 9
native Specifies that a method is not implemented in the same Java source file (but in another language)
new Creates new objects
package Declares a package
private An access modifier used for attributes, methods and constructors, making them only accessible within the declared class
protected An access modifier used for attributes, methods and constructors, making them accessible in the same package and subclasses
public An access modifier used for classes, attributes, methods and constructors, making them accessible by any other class
requires Specifies required libraries inside a module. New in Java 9
return Finished the execution of a method, and can be used to return a value from a method
short A data type that can store whole numbers from -32768 to 32767
static A non-access modifier used for methods and attributes. Static methods/attributes can be accessed without creating an object of a class
strictfp Restrict the precision and rounding of floating point calculations
super Refers to superclass (parent) objects
switch Selects one of many code blocks to be executed
synchronized A non-access modifier, which specifies that methods can only be accessed by one thread at a time
this Refers to the current object in a method or constructor
throw Creates a custom error
throws Indicates what exceptions may be thrown by a method
transient A non-accesss modifier, which specifies that an attribute is not part of an object's persistent state
try Creates a try...catch statement
var Declares a variable. New in Java 10
void Specifies that a method should not have a return value
volatile Indicates that an attribute is not cached thread-locally, and is always read from the "main memory"
while Creates a while loop

참고: true , false, 및 null는 키워드가 아니지만 식별자로 사용할 수 없는 리터럴 및 예약어입니다.