X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
449f495
BREAKING CHANGE: cleanup old project code
arghyaxcodes May 12, 2025
a518658
feat(app): initialize documentation site with Fumadocs and Next.js
arghyaxcodes May 12, 2025
66fcd72
feat(site): migrate layout and home page to new site structure
arghyaxcodes Jul 19, 2025
d3bdf52
feat(layout): update app title to 'Javaistic' in layout configuration
arghyaxcodes Jul 19, 2025
1bb6fd4
feat(deps): add lucide-react and update fumadocs dependencies; refact…
arghyaxcodes Jul 19, 2025
5035aee
Merge pull request #719 from javaistic/feat/update-site
arghyaxcodes Jul 19, 2025
616ac89
feat(docs): Add tutorials for Java static keyword, switch statement, …
arghyaxcodes Jul 19, 2025
e0d22ad
feat(aasets): Add assets for docs
arghyaxcodes Jul 19, 2025
19c68ee
feat(docs): Revise index and JVM documentation for clarity and struct…
arghyaxcodes Jul 20, 2025
405d901
feat(docs): Reorganize meta.json pages for improved structure and cla…
arghyaxcodes Jul 20, 2025
49796d0
feat(docs/layout): Refactor layout component to use updated DocsLayou…
arghyaxcodes Jul 20, 2025
3f7591a
feat(mdx): Add icons to MDX components for enhanced rendering
arghyaxcodes Jul 20, 2025
bdca874
Merge pull request #720 from javaistic/feat/add-docs-content
arghyaxcodes Jul 20, 2025
bf45b74
feat(programs/config): Add programs source loader and update imports
arghyaxcodes Jul 20, 2025
3b8c738
feat(source): Add icon handling to programsSource loader
arghyaxcodes Jul 20, 2025
4892973
feat(programs): Add page and layout components for program documentation
arghyaxcodes Jul 20, 2025
83d20b6
feat(layout): Update layout configuration with new SVG logo and links
arghyaxcodes Jul 20, 2025
c97c035
feat(programs): Add multiple Java programs including addition, multip…
arghyaxcodes Jul 20, 2025
b0fd184
Merge pull request #721 from javaistic/feat/add-java-programs
arghyaxcodes Jul 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .babelrc

This file was deleted.

12 changes: 0 additions & 12 deletions .editorconfig

This file was deleted.

9 changes: 0 additions & 9 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": ["next", "next/core-web-vitals"]
"extends": ["next/core-web-vitals", "next/typescript"]
}
32 changes: 14 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
# deps
/node_modules
/.pnp
.pnp.js

# testing
/coverage
# generated content
.contentlayer
.content-collections
.source

# next.js
# test & build
/coverage
/.next/
/out/

# production
/build
*.tsbuildinfo

# misc
.DS_Store

# debug
*.pem
/.pnp
.pnp.js
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# others
.env*.local
.vercel
next-env.d.ts
1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

1,354 changes: 1,354 additions & 0 deletions bun.lock

Large diffs are not rendered by default.

Binary file removed bun.lockb
Binary file not shown.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ description: In this tutorial, you will learn simple ways to display output to

---

import { TipInfo } from '@/components/Tip'

## Java Output
In Java, you can simply use
Expand Down Expand Up @@ -173,11 +172,9 @@ In the above example, we have created an object named `input` of the `Scanner` c

Similarly, we can use `nextLong()`, `nextFloat()`, `nextDouble()`, and `next()` methods to get `long`, `float`, `double`, and `string` input respectively from the user.

<TipInfo>

<Callout>
**Note:** We have used the `close()` method to close the object. It is recommended to close the scanner object once the input is taken.

</TipInfo>
</Callout>

### Example: Get float, double and String Input
```java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ Here is the syntax of the break statement in Java:
break;
```

import { List, ListItemGood } from '@/components/List'
import { TipInfo } from '@/components/Tip'


## Example 1: Java break statement

Java while loop is used to run a specific code until a certain condition is met. The syntax of the while loop is:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
title: Java Class and Objects
description: In this tutorial, we will learn about classes and objects in Java with the help of examples.
---
import { TipInfo } from "@/components/Tip";

Java is an object-oriented programming language. The core concept of the object-oriented approach is to break complex problems into smaller objects.

Expand Down Expand Up @@ -53,11 +52,11 @@ In the above example, we have created a class named `Bicycle`. It contains a fie

Here, `Bicycle` is a prototype. Now, we can create any number of bicycles using the prototype. And, all the bicycles will share the fields and methods of the prototype.

<TipInfo>
<Callout>

**Note:** We have used keywords private and public. These are known as access modifiers. To learn more, visit Java access modifiers.

</TipInfo>
</Callout>

---

Expand All @@ -81,11 +80,11 @@ Here, `sportsBicycle` and `touringBicycle` are the names of objects. We can use

As you can see, we have created two objects of the class. We can create multiple objects of a single class in Java.

<TipInfo>
<Callout>

**Note:** Fields and methods of a class are also called members of the class.

</TipInfo>
</Callout>

---

Expand Down Expand Up @@ -128,7 +127,7 @@ Now that we understand what is class and object. Let's see a fully working examp
### Example: Java Class and Objects
```java
class Lamp {

// stores the value for light
// true if light is on
// false if light is off
Expand Down Expand Up @@ -189,7 +188,7 @@ However, we can also create objects inside the same class.

```java
class Lamp {

// stores the value for light
// true if light is on
// false if light is off
Expand All @@ -203,7 +202,7 @@ class Lamp {
}

public static void main(String[] args) {

// create an object of Lamp
Lamp led = new Lamp();

Expand Down
7 changes: 2 additions & 5 deletions src/pages/docs/comments.mdx → content/docs/comments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ description: In this tutorial, you will learn about Java comments, why we use t
---


import { TipInfo } from '@/components/Tip'


In computer programming, comments are a portion of the program that are completely ignored by Java compilers. They are mainly used to help programmers to understand the code. For example,

```java
Expand Down Expand Up @@ -92,8 +89,8 @@ One thing you should always consider that comments shouldn't be the substitute f

Some believe that code should be self-describing and comments should be rarely used. However, in my personal opinion, there is nothing wrong with using comments. We can use comments to explain complex algorithms, regex or scenarios where we have to choose one technique among different technique to solve problems.

<TipInfo>
<Callout>

**Note:** In most cases, always use comments to explain **'why'** rather than **'how'** and you are good to go.

</TipInfo>
</Callout>
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ If we do not create any constructor, the Java compiler automatically creates a n
This constructor is called the default constructor.

### Example: Default Constructor
```java
```java
class Main {

int a;
Expand Down Expand Up @@ -323,8 +323,8 @@ Here, both the constructors initialize the value of the variable language with d
Based on the parameter passed during object creation, different constructors are called, and different values are assigned.
It is also possible to call one constructor from another constructor. To learn more, visit Java Call One Constructor from Another.

<TipInfo>
<Callout>

**Note:** We have used this keyword to specify the variable of the class. To know more about this keyword, visit [Java this keyword](/docs/this-keyword).

</TipInfo>
</Callout>
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ While working with loops, sometimes you might want to skip some statements or te

To learn about the break statement, visit Java break. Here, we will learn about the continue statement.

import { List, ListItemGood } from '@/components/List'
import { TipInfo } from '@/components/Tip'

## Java continue

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ title: Java Expressions, Statements and Blocks
description: In this tutorial, you will learn about Java expressions, Java statements, difference between expression and statement, and Java blocks with the help of examples.
---

import { TipInfo } from '@/components/Tip'

In previous chapters, we have used expressions, statements, and blocks without much explaining about them. Now that you know about variables, operators, and literals, it will be easier to understand these concepts.

## Java Expressions
Expand Down Expand Up @@ -71,11 +69,11 @@ In Java, declaration statements are used for declaring variables. For example,
Double tax = 9.5;
```
The statement above declares a variable tax which is initialized to 9.5.
<TipInfo>
<Callout>

**Note:** There are control flow statements that are used in decision making and looping in Java. You will learn about control flow statements in later chapters.

</TipInfo>
</Callout>

## Java Blocks

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ cannot assign a value to final variable AGE
AGE = 45;
^
```
<Callout title="Note">
The `final` keyword is often used to define constants in Java, which are typically named in uppercase letters.
</Callout>

> **Note:** By convention, `final` variables in Java are typically written in uppercase.

## 2. final Method in Java
A `final` method cannot be overridden by subclasses. For example:
Expand Down Expand Up @@ -63,7 +65,7 @@ class Main extends FinalDemo {

Here, the `display()` method in the `FinalDemo` class is `final`, so it cannot be overridden in the `Main` class. Attempting to do so will generate a compilation error:

```plaintext
```plaintext title="Compilation Error" icon="<Atom/>"
display() in Main cannot override display() in FinalDemo
public final void display() {
^
Expand Down
18 changes: 4 additions & 14 deletions src/pages/docs/for-loop.mdx → content/docs/for-loop.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
title: Java for Loop
description: In this tutorial, we will learn how to use for loop in Java with the help of examples and we will also learn about the working of Loop in computer programming.
---
import NextImage from 'next/image';

In computer programming, loops are used to repeat a block of code. For example, if you want to show a message 100 times, then rather than typing the same code 100 times, you can use a loop.

Expand Down Expand Up @@ -37,17 +36,8 @@ To learn more about the conditions, visit [Java relational](operators#3-java-rel

<div>

<NextImage
className="object-cover object-center shadow-xl"
alt="Working of Java if statement"
src={require('@/img/docs/working-of-for-loop.svg').default}
width={876}
height={1307}
blurDataURL={require('@/img/docs/working-of-for-loop.svg').default}
placeholder="blur"
loading="lazy"
quality={100}
/>

![Working of Java if statement](/img/docs/working-of-for-loop.svg)

<p align="center" className="text-base text-gray-600 font-medium">Flowchart of Java for loop</p>

Expand Down Expand Up @@ -85,7 +75,7 @@ Java is fun

Here is how this program works.

| Iteration | Variable | Condition: i <= n | Action |
| Iteration | Variable | Condition: i `<=` n | Action |
| :-------: | :--------------: | :---------------: | :-------------------------------------------------: |
| 1st | `i = 1`, `n = 5` | `true` | `Java is fun` is printed `i` is increased to **2**. |
| 2nd | `i = 2`, `n = 5` | `true` | `Java is fun` is printed `i` is increased to **3**. |
Expand Down Expand Up @@ -125,7 +115,7 @@ class Main {

Here is how the program works.

| Iteration | Variable | Condition: i <= n | Action |
| Iteration | Variable | Condition: i `<=` n | Action |
| :-------: | :--------------: | :---------------: | :---------------------------------------: |
| 1st | `i = 1`, `n = 5` | `true` | `1` is printed `i` is increased to **2**. |
| 2nd | `i = 2`, `n = 5` | `true` | `2` is printed `i` is increased to **3**. |
Expand Down
21 changes: 7 additions & 14 deletions src/pages/docs/hello-world.mdx → content/docs/hello-world.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@ title: Hello World
description: In this tutorial, you will learn to write "Hello World" program in Java.
---

import { List, ListItemGood } from '@/components/List'


A "Hello, World!" is a simple program that outputs `Hello, World!` on the screen. Since it's a very simple program, it's often used to introduce a new programming language to a newbie.

Let's explore how Java "Hello, World!" program works.

## Java "Hello, World!" Program

#### Input

```java
```java title="HelloWorld.java"
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
Expand All @@ -23,9 +18,7 @@ class HelloWorld {

```

#### Output

```plaintext
```bash title="Output"
Hello, World!
```

Expand Down Expand Up @@ -70,11 +63,11 @@ Notice the print statement is inside the main function, which is inside the clas

## Things to take away

<List>
<ListItemGood>Every valid Java Application must have a class definition (that matches the filename)</ListItemGood>
<ListItemGood>The main method must be inside the class definition.</ListItemGood>
<ListItemGood>The compiler executes the codes starting from the main function.</ListItemGood>
</List>

- Every valid Java Application must have a class definition (that matches the filename)
- The main method must be inside the class definition.
- The compiler executes the codes starting from the main function.


This is a valid Java program that does nothing.

Expand Down
Loading
Loading
X Tutup