1
1
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:
divlo 2021-06-24 22:10:08 +02:00
parent 719058b2ff
commit 8a41cb67f0
No known key found for this signature in database
GPG Key ID: 185ED2F15F104E52
6 changed files with 34 additions and 2 deletions

View File

@ -21,8 +21,9 @@ Each challenge has its **solutions**, its **instructions** and **input/output ex
### ✅ Programming languages available
- [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/)
- [Java (OpenJDK)](https://openjdk.java.net/)
- [JavaScript/TypeScript (Node.js)](https://nodejs.org/)
- [Python](https://www.python.org/)
- [Rust](https://www.rust-lang.org/)

View File

@ -0,0 +1,3 @@
# hello-world/java/function
Created by [@Divlo](https://github.com/Divlo) on 24 June 2021.

View 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 + "!");
}
}
}

View File

@ -6,7 +6,7 @@ import { Solution } from './Solution'
const git = simpleGit()
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 {

View File

@ -0,0 +1,4 @@
FROM openjdk:17
COPY ./ ./
RUN javac Solution.java
CMD ["java", "Solution"]

View 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 + "!");
}
}
}