mirror of
https://github.com/theoludwig/programming-challenges.git
synced 2024-12-08 00:45:29 +01:00
feat(languages): add Java support
This commit is contained in:
parent
719058b2ff
commit
8a41cb67f0
@ -21,8 +21,9 @@ Each challenge has its **solutions**, its **instructions** and **input/output ex
|
|||||||
### ✅ Programming languages available
|
### ✅ Programming languages available
|
||||||
|
|
||||||
- [C/C++ (gcc)](https://gcc.gnu.org/)
|
- [C/C++ (gcc)](https://gcc.gnu.org/)
|
||||||
- [C# (.NET Core)](https://docs.microsoft.com/en-us/dotnet/csharp/)
|
- [C# (.NET)](https://docs.microsoft.com/dotnet/csharp/)
|
||||||
- [Dart](https://dart.dev/)
|
- [Dart](https://dart.dev/)
|
||||||
|
- [Java (OpenJDK)](https://openjdk.java.net/)
|
||||||
- [JavaScript/TypeScript (Node.js)](https://nodejs.org/)
|
- [JavaScript/TypeScript (Node.js)](https://nodejs.org/)
|
||||||
- [Python](https://www.python.org/)
|
- [Python](https://www.python.org/)
|
||||||
- [Rust](https://www.rust-lang.org/)
|
- [Rust](https://www.rust-lang.org/)
|
||||||
|
3
challenges/hello-world/solutions/java/function/README.md
Normal file
3
challenges/hello-world/solutions/java/function/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# hello-world/java/function
|
||||||
|
|
||||||
|
Created by [@Divlo](https://github.com/Divlo) on 24 June 2021.
|
12
challenges/hello-world/solutions/java/function/Solution.java
Normal file
12
challenges/hello-world/solutions/java/function/Solution.java
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
public class Solution {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String line;
|
||||||
|
Scanner scanner = new Scanner(System.in);
|
||||||
|
while(scanner.hasNextLine()) {
|
||||||
|
line = scanner.nextLine();
|
||||||
|
System.out.println("Hello, " + line + "!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -6,7 +6,7 @@ import { Solution } from './Solution'
|
|||||||
const git = simpleGit()
|
const git = simpleGit()
|
||||||
|
|
||||||
const solutionsRegex = new RegExp(
|
const solutionsRegex = new RegExp(
|
||||||
/challenges\/[\s\S]*\/solutions\/(c|cpp|cs|dart|javascript|python|rust|typescript)\/[\s\S]*\/(solution|Solution).(c|cpp|cs|dart|js|py|rs|ts)/
|
/challenges\/[\s\S]*\/solutions\/(c|cpp|cs|dart|java|javascript|python|rust|typescript)\/[\s\S]*\/(solution|Solution).(c|cpp|cs|dart|java|js|py|rs|ts)/
|
||||||
)
|
)
|
||||||
|
|
||||||
class GitAffected {
|
class GitAffected {
|
||||||
|
4
templates/docker/java/Dockerfile
Normal file
4
templates/docker/java/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
FROM openjdk:17
|
||||||
|
COPY ./ ./
|
||||||
|
RUN javac Solution.java
|
||||||
|
CMD ["java", "Solution"]
|
12
templates/solution/java/Solution.java
Normal file
12
templates/solution/java/Solution.java
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
public class Solution {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String line;
|
||||||
|
Scanner scanner = new Scanner(System.in);
|
||||||
|
while(scanner.hasNextLine()) {
|
||||||
|
line = scanner.nextLine();
|
||||||
|
System.out.println("Hello, " + line + "!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user