We can code Java in English as well as in many other languages like Marathi, Hindi etc. In order to make Java code readable in another language we have to change our program’s encoding to “UTF-8 Encoding”.
public class AnyLanguageUser { public static void main(String []yuvraj_patil){ int त्रिज्या = 20; int व्यास = 2 * त्रिज्या; System.out.println(व्यास); } };
javac –encoding UTF-8 AnyLanguageUser.java
java AnyLanguageUser
Similarly we can write method names in local languages in the following way
public class AnyLanguageUser { public static void main(String []yuvraj_patil){ int लांबी = 20; int रुंदी = 10; int क्षेत्रफळ = त्रिकोणाचेक्षेत्रफळमोजणे(लांबी , रुंदी ) ; System.out.println(क्षेत्रफळ) ; } public static int त्रिकोणाचेक्षेत्रफळमोजणे (int लांबी,int रुंदी ){ int क्षेत्रफळ = लांबी * रुंदी ; return क्षेत्रफळ; } };