Java Dekon'nichiwa world (Tsu learn quickly grammar in Vim and Quickrun)

Screen Shot 2018-10-03 at 8.11.58.png

Summary

java file with Vim Quickrun

Revision history

2018/10/03 wed
Corrected the class / variable name advised by shiracamus in the comment
Global variable foo_Is pending correction

file organization

$ tree
.
└── MyProj               // project folder ( working folder )
    ├── main
    │   └── Main.java    // entry file
    └── myclass
        └── Hello.java   // your own classes


3 directories, 2 files

Quickrun

\ 'java': {
\   'exec': ['javac -cp %s:p:h:h:h */*.java', 'java -cp %s:p:h:h:h:%s:p:h %s:t:r %a' ],
\   'hook/output_encode/encoding': '&termencoding',
\   'hook/sweep/files': '%S:p:r.class',
\ },

Java's code

entry class

// Main.java
import MyProj.myclass.*;

public class Main {

    public static void main(String[] argv){

        Hello hello = new Hello("world!");
        hello.sayHello();

    }

}

your own classes

// Hello.java
package MyProj.myclass;

public class Hello {

    private String str_ = "hello ";

    public Hello( String s ){
        this.str_ = this.str_ + s;
    }

    public void sayHello(){
        System.out.println( this.str_ );
    }

}

Reference

I want to import my own class quickrun help

Recommended Posts

Java Dekon'nichiwa world (Tsu learn quickly grammar in Vim and Quickrun)
Hello world in Java and Gradle
Learn Flyweight patterns and ConcurrentHashMap in Java
"Hello World" in Java
Hello World in Java
Java history in this world
Compare Hello, world! In Spring Boot with Java, Kotlin and Groovy
Encoding and Decoding example in Java
How to learn JAVA in 7 days
Hello World in java in eclipse now
StringBuffer and StringBuilder Class in Java
Understanding equals and hashCode in Java