java.lang.Character isBmpCodePoint(int codePoint)

Description

The Character.isBmpCodePoint(int codePoint) java method determines whether the specified character (Unicode code point) is in the Basic Multilingual Plane (BMP). Such code points can be represented using a single char.

The isBmpCodePoint(int codePoint) method of Character class is static thus it should be accessed statically which means the we would be calling this method in this format:

Character.isBmpCodePoint(int codePoint)

Non static method is usually called by just declaring method_name(argument) however in this case since the method is static, it should be called by appending the class name as suffix. We will be encountering a compilation problem if we call the java isBmpCodePoint() method non statically.

Method Syntax

public static boolean isBmpCodePoint(int codePoint)

Method Argument

Data Type Parameter Description
int codePoint the character (Unicode code point) to be tested

Method Returns

The isBmpCodePoint(int codePoint) method of Character class returns true if the specified code point is between MIN_VALUE and MAX_VALUE inclusive; false otherwise.

Compatibility

Requires Java 1.7 and up

Java Character isBmpCodePoint(int codePoint) Example

Below is a simple java example on the usage of isBmpCodePoint(int codePoint) method of Character class.

package com.javatutorialhq.java.examples;

/*
 * This example source code demonstrates the use of 
 * isBmpCodePoint(int codePoint) method of Character class.
 */

public class CharacterIsBmpCodePointExample {

	public static void main(String[] args) {
		
		// initialize codepoints
		int codepoint1 = 12;
		int codepoint2 = 1231212;
		
		// check the codepoints if it is in Basic Multilingual Plane (BMP)
		boolean result1 = Character.isBmpCodePoint(codepoint1);
		boolean result2 = Character.isBmpCodePoint(codepoint2);
		
		// print the result
		System.out.println("Is codepoint "+codepoint1 +
				" is in BMP?"+result1);
		System.out.println("Is codepoint "+codepoint2 +
				" is in BMP?"+result2);
	

	}

}

Sample Output

Below is the sample output when you run the above example.

java Character isBmpCodePoint(int codePoint) example output