Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

public class Main {
    public static void main(String[] args) {
        char ch1 = 'M', ch2 = '\u06aa';

        byte b1 = Character.getDirectionality(ch1);
        byte b2 = Character.getDirectionality(ch2);

        if (b1 == 0) {
            System.out.println("DIRECTIONALITY_LEFT_TO_RIGHT");
        }
        if (b2 == 2) {
            System.out.println("DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC");
        }
    }
}