From d67ac89ef8dadecc551869527c8c3ff1dc36691f Mon Sep 17 00:00:00 2001 From: Mysterious-Developer Date: Sun, 3 Oct 2021 01:01:39 +0530 Subject: [PATCH] Create unicode.java --- unicode.java | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 unicode.java diff --git a/unicode.java b/unicode.java new file mode 100644 index 0000000..2ede05b --- /dev/null +++ b/unicode.java @@ -0,0 +1,40 @@ +import java.io.*; + +class unicode { + + + public static void main(String[] args) + { + + + try { + + + String str = "Geeksforgeeks"; + + + int result_1 = str.codePointAt(0); + + + int result_2 = str.codePointAt(-4); + + + System.out.println("Original String : " + str); + + + System.out.println("Character(unicode point) = " + + result_1); + + + System.out.println("Character(unicode point) = " + + result_2); + } + + + catch (IndexOutOfBoundsException e) { + + + System.out.println("Exception thrown :" + e); + } + } +}