feat(constants): add Java to supported languages and include default code snippet

This commit is contained in:
ngc2207 2025-01-04 14:42:52 +08:00
parent e98bb9269e
commit c96b870861
2 changed files with 15 additions and 1 deletions

View File

@ -1,8 +1,14 @@
import { COriginal, CplusplusOriginal, PythonOriginal } from "devicons-react"; import {
COriginal,
CplusplusOriginal,
JavaOriginal,
PythonOriginal,
} from "devicons-react";
export const SUPPORTED_LANGUAGES = [ export const SUPPORTED_LANGUAGES = [
{ key: "c", value: "c", label: "C", icon: COriginal }, { key: "c", value: "c", label: "C", icon: COriginal },
{ key: "cpp", value: "cpp", label: "C++", icon: CplusplusOriginal }, { key: "cpp", value: "cpp", label: "C++", icon: CplusplusOriginal },
{ key: "java", value: "java", label: "Java", icon: JavaOriginal },
{ key: "python", value: "python", label: "Python", icon: PythonOriginal }, { key: "python", value: "python", label: "Python", icon: PythonOriginal },
]; ];

View File

@ -14,6 +14,14 @@ using namespace std;
int main() { int main() {
cout << "Hello, World!"; cout << "Hello, World!";
return 0; return 0;
}`,
},
{
key: "java",
value: `public class Main {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}`, }`,
}, },
{ {