简体   繁体   中英

Replacing keywords with abbreviations in Java

I'm trying to create a kind of "shorthand" syntax for Java that replaces verbose keywords with less verbose ones, so that I can write Java code with fewer keystrokes. Is there any way to replace keywords such as "public" and "static" with abbreviations of those keywords, and then translate that to "normal" Java code?

//would it be possible to convert this to "normal" Java code?
pu cl ModifiedSyntaxExample{
    pu st void main(){
        System.out.println("Hello World!")
    }
}

This would be equivalent to:

//would it be possible to convert this to "normal" Java code?
public class ModifiedSyntaxExample{
    public static void main(){
        System.out.println("Hello World!")
    }
}

The first version is less verbose (and therefore easier to type), because "public" and "class" are replaced with the abbreviations "pu" and "st".

If you are using any IDE than yes, its possible. For example in eclipse you have one code snippets which you can configure in such a way that, you will make your code less verbose. I hope I have understood your question correctly. for ex - sysout will print System.out.println(); for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM