JQuickLang is a lightweight Java-like scripting language designed for concise and efficient programming. It combines Java's type system with JavaScript's flexibility, making it ideal for rapid prototyping, education, and small projects.
- Overview
- Core Features
- Program Structure
- Data Types
- Expressions
- Control Structures
- Invocation Styles
- Output
- Comments
- Code Samples
- Appendix
- Complete Examples
- 7 Primitive types built-in
- Full generics support
- Flexible collections (List/Set/Map)
- dimensional arrays
// Primitive types
int counter = 0;
boolean enabled = true;
// Generic collections
List<String> names = ["Alice", "Bob"];
Map<String, Integer> scores = {"Math":90, "English":85};
import com.example.pkg as pkgAlias;
int x = 10;
console.log(x);
| Component | Description |
|---|---|
| qualified.name | dot-separated path (e.g., java.lang.String) |
| as | alias name |
| Keyword | Example | Description |
|---|---|---|
| simpleType | int x = 10; |
Type inferred |
| TypeName | String s = "hi"; |
Explicit type (optional) |
| Type Keyword | Data Type | Example |
|---|---|---|
| short | Short integer | short s = 100; |
| int | Integer | int x = 42; |
| float | Floating point | float pi = 3.14; |
| double | Double | double d = 9.99; |
| long | Long integer | long big = 100; |
| boolean | Boolean | boolean flag = true; |
| byte | Byte | byte b = 0x1F; |
| Null | null | null |
| Date | Date | 2025-06-07 |
| Date | Date | 2025-06-07 12:00:01 |
| Type Format | Example |
|---|---|
| Generic (Type) | List<String> names; |
| Generic Multi (Type<K,V>) | Map<String, Integer> scores; |
| List | List<Double> prices; |
| Set | Set<Employee> staff; |
| Array | int[] numbers = {1,2,3}; |
| Custom Class | MyClass obj = new MyClass(); |
| Import Alias | import java.util.Date as JDate; |
import List<java.lang.String> as StringList ;
StringList list=["A","B","C"];
| Operator Group | Operators | Example | Desc |
|---|---|---|---|
| Mul | * |
1*1 | number * number |
| Div | / |
1/1 | number / number |
| Add | + |
1+1 | number + number string+string |
| Sub | - |
1-1 | number - number |
| GT | > |
1>1 | number > number |
| GE | >= |
1>=1 | number * number |
| LT | < |
1<1 | number < number |
| LE | <= |
1<=1 | number <= number |
| NE | != |
1 !=1 | number != number |
| EQ | == |
1==1 | number == number |
| AND | && |
true&& true | boolean && boolean |
| OR | || | true || false | boolean|| boolean |
| PAREN | (expression) | (a + b) * 2 > 10 && x != y | boolean|| boolean |
(a + b) * 2 > 10 && x != y
if(false){
console.log(1);
}else if(true){
console.log(2);
}else if(false){
console.log(3);
}else{
console.log(4);
}
for (int i = 0; i < 10; i = i + 1) {
for (int j = 0; j < 10; j = j + 1){
if(j==2){
continue;
}else{
console.log(i+","+j); }
}
};
while(true){
for (int a = 0; a<10; a=a+1){
if(a==2){
continue;
}else{
console.log("当前的变量a:"+a);
}
}
break;
}
int function funtionName(int:a, int:b) {
return a + b;
}
import List<java.lang.String> as StringList ;
StringList function funtionName(StringList:a, int:b) {
return a;
}
| Type | Example |
|---|---|
| Static Method | Math::max(1, 2) |
| Constructor | new ArrayList() |
| Instance Method | list.add("item") |
| This-context | this.doSomething() |
- sample
java.lang.Math::max(int:5, int:10);
output:10
- sample
java.lang.Math::pow(double:2, double:3);
output:8.0
- sample
java.lang.String::valueOf(int:123);
output:123
- sample
java.util.Objects::toString(java.lang.String:null);
output:null
- sample
java.lang.String::format(java.lang.String:"Number: %d, String: %s",int: 42, java.lang.String:"test");
output:Number: 42, String: test
- sample
java.lang.System::currentTimeMillis();
output:1754713207541
- sample
java.lang.String::join(java.lang.CharSequence:",", java.lang.CharSequence:"a",java.lang.CharSequence: "b", java.lang.CharSequence:"c");
output:a,b,c
- sample
com.github.paohaijiao.service.JService::sum(int:1,int:2);
output:3
- sample
new com.github.paohaijiao.service.JService();
- sample
new com.github.paohaijiao.model.JStudent(int:42, float:3.14, boolean:true);
- sample
new com.github.paohaijiao.model.JStudent(java.lang.String:"test string");
- sample
new com.github.paohaijiao.model.JStudent(List<java.lang.Integer>:listVar);
- sample
new com.github.paohaijiao.model.JStudent(java.lang.String:"test", java.lang.Integer:123, java.lang.Boolean:true, List<java.lang.Integer>:listVar);
- sample
new java.util.ArrayList();
- sample
new com.github.paohaijiao.model.JStudent(java.lang.String:"a", java.lang.String:"b", java.lang.String:"c");
- sample
testObj.isEven(int:4);
output: true
- sample
testObj.noReturn();
- sample
testObj.addToList(java.util.ArrayList<java.lang.Integer>:listVar, java.lang.Integer:4);
- sample
testObj.methodWithMixedArgs(java.lang.String:"Test", int:42, boolean:true);
- sample
testObj.methodWithVarArgs(java.lang.String:"a", java.lang.String:"b", java.lang.String:"c");
console.log("Result: " + result);
// single-line
/*
multi-line
*/
java.lang.String function a(int:a,float:b) {
java.lang.String p=java.lang.String::format(java.lang.String:"Number: %d, String: %s",int: 42, java.lang.String:"test");
return p;
}
int c=1;
float d=8.1;
this.a(int:c,float:d);
java.util.HashMap<java.lang.String,java.lang.String> function a(int:a,float:b) {
java.lang.String str1 = new java.lang.String(java.lang.String:"Hello");
console.log(str1);
java.lang.String upperStr = str1.toUpperCase();
console.log(upperStr);
java.lang.String subStr = str1.substring(int:1, int:3);
console.log(subStr);
java.util.HashMap<java.lang.String,java.lang.String> result = new java.util.HashMap();
result.put(java.lang.String:"constructed1", java.lang.String:str1);
result.put(java.lang.String:"constructed2", java.lang.String:str1);
result.put(java.lang.String:"uppercased", java.lang.String:upperStr);
result.put(java.lang.String:"substring", java.lang.String:subStr);
return result;
}
int c=1;
float d=8.1;
this.a(int:c,float:d);
global,
short,
int,
float,
double,
long,
boolean,
byte,
new,
var,
return,
function,
null,
this,
import,
continue,
break,
as,
if,
else,
for,
while,
true,
false,
null
1.starts with letter/underscore
2.may contain letters, digits, underscores
3.case-sensitive
- sample 1
int function getSquare(int:a,int:b){
return a*b;
}
int a=1;
int b=2;
int c=this.getSquare(int:a,int:b);
- sample 2
java.util.HashMap<java.lang.String,java.lang.String> function a(int:a,float:b) {
java.lang.String str1 = new java.lang.String(java.lang.String:"Hello");
console.log(str1);
java.lang.String upperStr = str1.toUpperCase();
console.log(upperStr);
java.lang.String subStr = str1.substring(int:1, int:3);
console.log(subStr);
java.util.HashMap<java.lang.String,java.lang.String> result = new java.util.HashMap(); result.put(java.lang.String:"constructed1", java.lang.String:str1); result.put(java.lang.String:"constructed2", java.lang.String:str1);
result.put(java.lang.String:"uppercased", java.lang.String:upperStr); result.put(java.lang.String:"substring", java.lang.String:subStr);
return result;
}
int c=1;
float d=8.1;
this.a(int:c,float:d);
- sample 3
java.lang.String function a(int:a,float:b) {
java.lang.String p=java.lang.String::format(java.lang.String:"Number: %d, String: %s",int: 42, java.lang.String:"test");
return p;
}
int c=1;
float d=8.1;
this.a(int:c,float:d);
- sample 4
import java.lang.String as type1;
type1 function a(int:a,float:b) {
type1 p=type1::format(type1:"Number: %d, String: %s",int: 42, type1:"test");
return p;
}
int c=1;
float d=8.1;
this.a(int:c,float:d);
Thank you for using this open-source project! It is completely free and will be maintained continuously, but the developers do need your support.
-
Buy Me a Coffee
If this project has saved you time or money, please consider supporting me with a small donation. -
Where Your Donation Goes
- Server costs to keep the project running.
- Feature development to add more value.
- Documentation optimization for a better user experience.
- Every Cent Counts
Even a donation of just 1 cent motivates me to debug late into the night!
✔️ Keep the project free and ad-free forever.
✔️ Support timely responses to issues and community inquiries.
✔️ Enable planned features for the future.
Thank you for being a partner in making the open-source world better!
- The project is maintained with love and caffeine.
- Your support ensures its sustainability and growth.
Feel free to leave a message via email when sponsoring. Your name will be included in the "Special Thanks" list in the project's README file!
