https://github.com/readingbat/readingbat-java-content
ReadingBat Java Content
https://github.com/readingbat/readingbat-java-content
java kotlin readingbat
Last synced: about 2 months ago
JSON representation
ReadingBat Java Content
- Host: GitHub
- URL: https://github.com/readingbat/readingbat-java-content
- Owner: readingbat
- License: apache-2.0
- Created: 2020-04-17T18:33:16.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2026-03-30T18:28:51.000Z (2 months ago)
- Last Synced: 2026-03-30T20:28:20.042Z (2 months ago)
- Topics: java, kotlin, readingbat
- Language: Java
- Homepage: https://www.readingbat.com/content/java
- Size: 652 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ReadingBat Java Content
Java and Kotlin programming challenges for the [ReadingBat](https://github.com/readingbat/readingbat-core) platform. This repository defines challenge content that the ReadingBat server renders as interactive coding exercises.
## Getting Started
Requires JDK 17+.
```bash
./gradlew build -x test # Compile
./gradlew run # Start the content server on http://localhost:8080
./gradlew --rerun-tasks check # Run all tests
```
## Challenge Structure
Each challenge is a standalone source file with a `main()` that prints expected outputs. Those output lines become the answer key for the exercise.
**Java** (`src/main/java//`):
```java
// @desc Determine if one value is less than another with the **<** operator.
public class LessThan {
public static boolean compare(int val1, int val2) {
return val1 < val2;
}
public static void main(String[] args) {
System.out.println(compare(4, 6)); // true
System.out.println(compare(12, 8)); // false
}
}
```
**Kotlin** (`src/main/kotlin//`):
```kotlin
fun doubleIt(i: Int): Int = i * 2
fun main() {
println(doubleIt(5)) // 10
println(doubleIt(10)) // 20
}
```
All challenges are registered in `src/main/kotlin/Content.kt` using the `readingBatContent` DSL.