<img alt="" src="https://secure.leadforensics.com/150446.png " style="display:none;">
Go to top icon

Local languages in Java

Yuvraj Patil Dec 17, 2012

Eclipse Java Coding Java IDE UTF-8 Encoding Technology

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(व्यास);
    }
};

  • Using IDE (Eclipse)
  1. Write this program in Java Project of Eclipse.
  2. While saving the program, save it’s encoding as “UTF-8 Encoding”.
  3. Run as usual, it will print 40.

  • Using notepad and CMD prompt
    1. Write the above program in a java file and name that file as “AnyLanguageUser.java”
    2. While saving the program save it’s encoding as “UTF-8 Encoding”.
    3. Open the CMD prompt and compile it as below
    4. javac –encoding UTF-8 AnyLanguageUser.java
    5. Run it as below using the CMD prompt
    6. 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 क्षेत्रफळ;
        }
    };
    

    Similar Blog

    e-Zest is a leading digital innovation partner for enterprises and technology companies that utilizes emerging technologies for creating engaging customers experiences. Being a customer-focused and technology-driven company, it always helps clients in crafting holistic business value for their software development efforts. It offers software development and consulting services for cloud computing, enterprise mobility, big data and analytics, user experience and digital commerce.