catppuccin/samples/java.java

67 lines
1.8 KiB
Java
Raw Normal View History

/* Block comment */
2021-12-10 04:51:22 +00:00
import java.util.Date;
2021-12-10 04:51:22 +00:00
import static AnInterface.CONSTANT;
import static java.util.Date.parse;
import static SomeClass.staticField;
2021-12-14 23:00:29 +00:00
2021-12-10 04:51:22 +00:00
/**
* Doc comment here for <code>SomeClass</code>
*
* @param T type parameter
* @see Math#sin(double)
2021-12-10 04:51:22 +00:00
*/
@Annotation(name = value)
public class SomeClass<T extends Runnable> { // some comment
private T field = null;
private double unusedField = 12345.67890;
private UnknownType anotherString = "Another\nStrin\g";
public static int staticField = 0;
public final int instanceFinalField = 0;
protected final int protectedField = 0;
final int packagePrivateField = 0;
2021-12-10 04:51:22 +00:00
/**
* Semantic highlighting:
* Generated spectrum to pick colors for local variables and parameters:
* Color#1 SC1.1 SC1.2 SC1.3 SC1.4 Color#2 SC2.1 SC2.2 SC2.3 SC2.4 Color#3
* Color#3 SC3.1 SC3.2 SC3.3 SC3.4 Color#4 SC4.1 SC4.2 SC4.3 SC4.4 Color#5
*
* @param param1
* @param param2
* @param param3
*/
public SomeClass(AnInterface param1,
int param2,
int param3) {
int reassignedValue = this.staticField + param2 + param3;
long localVar1, localVar2, localVar3, localVar4;
int localVar = "IntelliJ"; // Error, incompatible types
System.out.println(anotherString + toString() + localVar);
int sum = protectedField + packagePrivateField + staticField;
long time = parse("1.2.3"); // Method is deprecated
new Thread().countStackFrames(); // Method is deprecated and marked for removal
reassignedValue++;
field.run();
new SomeClass() {
{
int a = localVar;
}
};
int[] l = new ArrayList<String>().toArray(new int[CONSTANT]);
}
}
2021-12-10 04:51:22 +00:00
enum AnEnum {CONST1, CONST2}
2021-12-10 04:51:22 +00:00
interface AnInterface {
int CONSTANT = 2;
2021-12-10 04:51:22 +00:00
void method();
}
2021-12-10 04:51:22 +00:00
abstract class SomeAbstractClass {
protected int instanceField = staticField;
2021-12-10 04:51:22 +00:00
}