DEV Community

Cover image for Java Variables, Data and int : 8 Questions I Had as a Beginner
Poushmita Paul
Poushmita Paul

Posted on

Java Variables, Data and int : 8 Questions I Had as a Beginner

Java Learning Notes — Telusko Core Java | Video 05

After learning how to set up Java and write my first Java program, I reached one of the most fundamental topics in programming:

Variables and data.

At first, variables seemed simple.

I saw code like:

int num = 3;
Enter fullscreen mode Exit fullscreen mode

and thought:

"Okay, num contains 3. That's all."

But when I started looking at the statement more carefully, several questions came up:

  • What exactly is a variable?
  • Why do I need to tell Java the type?
  • What does int actually mean?
  • Why is text stored using String?
  • What does = really do?
  • Why are there both print() and println()?
  • Can I perform calculations directly using variables?
  • Why would I store a calculation in another variable instead of printing it directly?

These questions helped me understand that variables are not just something to memorize.

They are one of the basic building blocks of programming.

This article contains what I understood from Video 05 — Variables, Data & the int Type, along with additional explanations and examples that helped me make the concepts clearer.

What This Article Covers

In this article, I will answer these eight questions:

  1. What is a variable?
  2. Why does Java require a variable type?
  3. What does int mean?
  4. What is String used for?
  5. What does = do?
  6. What is the difference between print() and println()?
  7. Can variables be used in arithmetic expressions?
  8. Why store an intermediate result in another variable?

I will also cover:

  • Data and processing
  • Database vs variable
  • Strong typing
  • Semicolons
  • Blocks
  • Recompiling after changes
  • Common beginner mistakes

1. What is a variable?

What I understood first

A variable is one of those programming concepts that sounds complicated until it is explained with a simple example.

A useful beginner-friendly way to imagine a variable is:

A named storage location that holds a value while the program is running.

For example:

int num = 3;
Enter fullscreen mode Exit fullscreen mode

Here, num is a variable.

I can think of it as a named box:

```text id="7e8f6c"
num
┌────────┐
│ 3 │
└────────┘




The name `num` allows me to refer to that stored value later.

For example:



```java
int num = 3;

System.out.println(num);
Enter fullscreen mode Exit fullscreen mode

The output is:

3
Enter fullscreen mode Exit fullscreen mode

Instead of repeatedly writing the value 3, I can use the variable name num.

Why are variables useful?

Imagine I am building a student application.

I might need to work with:

  • Student name
  • Age
  • Marks
  • Balance
  • Number of subjects

Instead of putting values directly everywhere, I can give them meaningful names.

For example:

String name = "Poushmita";
int age = 22;
int marks = 85;
Enter fullscreen mode Exit fullscreen mode

Now the program has named pieces of data that I can use later.

Variables can change

A variable can generally hold a different value later, as long as the new value is compatible with its declared type.

For example:

int score = 10;

score = 20;

System.out.println(score);
Enter fullscreen mode Exit fullscreen mode

The output is:

20
Enter fullscreen mode Exit fullscreen mode

The variable score initially held 10, and later it was assigned 20.

This is one reason it is called a variable.

Variable vs database

This distinction was also useful for me.

A database is generally used for persistent storage.

A variable is temporary working storage used while a program is executing.

A simple comparison:

Concept Purpose
Database Persistent storage
Variable Temporary working storage during program execution

For example, an application might retrieve a user's name from a database and temporarily store it in a variable while processing the request.

```text id="9h3yik"
Database

Stored data

Application

Variable

Processing




### 🧠 Easy to Remember

> **Variable = named storage for a value during program execution**

Think:

> **Name → Value**

For example:



```text
num → 3
Enter fullscreen mode Exit fullscreen mode

🎯 Short Interview Answer

A variable is a named storage location used to hold a value during program execution. It allows a program to store, access, and modify data.

2. Why does Java require a variable type?

What I understood first

This was one of the things that made Java look stricter than some other languages.

For example, in Java I write:

int num = 10;
Enter fullscreen mode Exit fullscreen mode

I don't simply write:

num = 10;
Enter fullscreen mode Exit fullscreen mode

I have to specify:

int
Enter fullscreen mode Exit fullscreen mode

Why?

Because Java is a strongly typed language.

What does strongly typed mean here?

When I declare a variable, I specify the type of data that the variable is intended to hold.

For example:

int age = 22;
Enter fullscreen mode Exit fullscreen mode

Here:

int
 ↓
Type

age
 ↓
Variable name

22
 ↓
Value
Enter fullscreen mode Exit fullscreen mode

The type tells Java what kind of value the variable is designed to store.

Another example:

String name = "Poushmita";
Enter fullscreen mode Exit fullscreen mode

Here:

String
 ↓
Type

name
 ↓
Variable name

"Poushmita"
 ↓
Value
Enter fullscreen mode Exit fullscreen mode

Why is this useful?

Suppose I have:

int age = 22;
Enter fullscreen mode Exit fullscreen mode

Java knows that age is intended to hold an integer value.

If I try to assign incompatible data to it, Java can detect the problem.

For example:

int age = "twenty two";
Enter fullscreen mode Exit fullscreen mode

This is not valid because "twenty two" is text, not an integer.

This type checking helps catch many mistakes before the program runs.

Types also communicate meaning

The type doesn't only help the compiler.

It also helps me as a developer understand the code.

Compare:

int age = 22;
Enter fullscreen mode Exit fullscreen mode

with:

String age = "22";
Enter fullscreen mode Exit fullscreen mode

Both may display 22, but they represent different kinds of data.

The first is a number.

The second is text.

That difference becomes very important when performing calculations.

🧠 Easy to Remember

Java wants to know what kind of data a variable is supposed to hold.

Think:

Type → Variable → Value
Enter fullscreen mode Exit fullscreen mode

🎯 Short Interview Answer

Java is strongly typed, so variables are declared with a type that specifies the kind of data they are intended to store. This provides type checking and helps make code more predictable and maintainable.

3. What does int mean?

What I understood first

int is one of the first data types I encountered in Java.

It represents an integer, meaning a whole-number value without a fractional part.

Examples include:

int num = 5;
int score = 10;
int balance = -5;
Enter fullscreen mode Exit fullscreen mode

So int can represent both positive and negative integer values within its defined range.

What is an integer?

An integer is a whole number.

Examples:

-10
-5
0
1
5
100
Enter fullscreen mode Exit fullscreen mode

These are integers.

But:

6.5
3.14
10.75
Enter fullscreen mode Exit fullscreen mode

are not integers because they contain fractional parts.

So this is not appropriate:

int price = 6.5;
Enter fullscreen mode Exit fullscreen mode

because 6.5 is not an integer.

Java has other types for values that require fractional parts, which I will explore in later lessons.

Breaking down int num = 5

Let's look at:

int num = 5;
Enter fullscreen mode Exit fullscreen mode

It contains several pieces:

```text id="h5lq0m"
int

Data type

num

Variable name

=

Assignment operator

5

Value

;

End of statement




Understanding this small statement is actually very important because the same pattern appears throughout Java:



```text
type variableName = value;
Enter fullscreen mode Exit fullscreen mode

More examples

int age = 22;
int marks = 85;
int temperature = -5;
int count = 100;
Enter fullscreen mode Exit fullscreen mode

All of these store integer values.

🧠 Easy to Remember

int = integer = whole-number values

Think:

int → -5, 0, 10, 100
Enter fullscreen mode Exit fullscreen mode

but not:

int → 6.5
Enter fullscreen mode Exit fullscreen mode

🎯 Short Interview Answer

int is a Java primitive data type used to store integer values, including positive and negative whole numbers.

4. What is String used for?

What I understood first

When I wanted to store text, I couldn't use int.

For example:

String name = "Poushmita";
Enter fullscreen mode Exit fullscreen mode

Here, String is used to represent text.

What is a String?

A String represents a sequence of characters.

Examples:

String name = "Poushmita";
String city = "Kolkata";
String message = "Hello World";
Enter fullscreen mode Exit fullscreen mode

The text is written inside double quotes.

Why can't I use int for text?

Because int is designed for integer values.

This is valid:

int age = 22;
Enter fullscreen mode Exit fullscreen mode

This is also valid:

String age = "22";
Enter fullscreen mode Exit fullscreen mode

But they are not the same thing.

In the first case:

22 → number
Enter fullscreen mode Exit fullscreen mode

In the second:

"22" → text
Enter fullscreen mode Exit fullscreen mode

That difference becomes important when I perform operations on the values.

For example:

int a = 10;
int b = 20;

System.out.println(a + b);
Enter fullscreen mode Exit fullscreen mode

produces:

30
Enter fullscreen mode Exit fullscreen mode

But string concatenation behaves differently:

String a = "10";
String b = "20";

System.out.println(a + b);
Enter fullscreen mode Exit fullscreen mode

produces:

1020
Enter fullscreen mode Exit fullscreen mode

This is a useful example of why the type of a variable matters.

🧠 Easy to Remember

String → text

Examples:

"Hello"
"Java"
"Poushmita"
Enter fullscreen mode Exit fullscreen mode

🎯 Short Interview Answer

String is used to represent text, which is a sequence of characters. String values are commonly written inside double quotes.

5. What does = do?

What I understood first

The symbol:

=
Enter fullscreen mode Exit fullscreen mode

looks like a mathematical equal sign.

But in a Java statement such as:

int num = 3;
Enter fullscreen mode Exit fullscreen mode

it does something slightly different.

In Java, = is the assignment operator.

It assigns the value or result of the expression on the right to the variable on the left.

Think right → left

For:

int num = 3;
Enter fullscreen mode Exit fullscreen mode

I can think:

3
↓
num
Enter fullscreen mode Exit fullscreen mode

or:

Put the value 3 into num.

So:

```text id="uq3jdu"
Right-hand side

assigned to

Left-hand side




### Example



```java
int num = 3;
Enter fullscreen mode Exit fullscreen mode

means:

Create an integer variable called num and assign 3 to it.

Then:

num = 10;
Enter fullscreen mode Exit fullscreen mode

means:

Assign 10 to the existing variable num.

Assignment can use expressions

The right side doesn't have to be a single value.

For example:

int num1 = 3;
int num2 = 5;

int result = num1 + num2;
Enter fullscreen mode Exit fullscreen mode

The expression:

num1 + num2
Enter fullscreen mode Exit fullscreen mode

is evaluated, and its result is assigned to result.

Conceptually:

num1 + num2
     ↓
     8
     ↓
 result
Enter fullscreen mode Exit fullscreen mode

Assignment vs comparison

This distinction is extremely important.

In Java:

=
Enter fullscreen mode Exit fullscreen mode

means:

Assignment

It does not mean "check whether two values are equal."

Comparison for equality uses:

==
Enter fullscreen mode Exit fullscreen mode

For example:

if (num == 10) {
    ...
}
Enter fullscreen mode Exit fullscreen mode

I don't need to go deeply into == yet, but remembering the difference now will prevent confusion later.

🧠 Easy to Remember

= → assignment

Think:

Right side → left side

🎯 Short Interview Answer

The = operator is the assignment operator in Java. It assigns the value of the expression on the right-hand side to the variable on the left-hand side.

6. What is the difference between print() and println()?

What I understood first

Both methods can display output.

For example:

System.out.print(5);
Enter fullscreen mode Exit fullscreen mode

and:

System.out.println(5);
Enter fullscreen mode Exit fullscreen mode

Both display:

5
Enter fullscreen mode Exit fullscreen mode

So what's the difference?

The difference is what happens after the output is printed.

print()

print() displays the value and keeps the cursor on the same line.

For example:

System.out.print(5);
System.out.print(15);
Enter fullscreen mode Exit fullscreen mode

Output:

515
Enter fullscreen mode Exit fullscreen mode

Both values appear on the same line.

println()

println() displays the value and then moves to the next line.

For example:

System.out.println(5);
System.out.println(15);
Enter fullscreen mode Exit fullscreen mode

Output:

5
15
Enter fullscreen mode Exit fullscreen mode

So:

print()
↓
Print and stay on same line

println()
↓
Print and move to next line
Enter fullscreen mode Exit fullscreen mode

A simple example

System.out.print("Hello ");
System.out.print("Java");
Enter fullscreen mode Exit fullscreen mode

Output:

Hello Java
Enter fullscreen mode Exit fullscreen mode

But:

System.out.println("Hello");
System.out.println("Java");
Enter fullscreen mode Exit fullscreen mode

Output:

Hello
Java
Enter fullscreen mode Exit fullscreen mode

Why is this useful?

When creating console applications, controlling how output appears can be important.

For example, if I want a sentence to be constructed on one line, I can use print().

If I want each piece of output on its own line, I can use println().

🧠 Easy to Remember

print() → same line

println() → new line

The ln in println is a helpful reminder:

ln → line

🎯 Short Interview Answer

print() displays output without moving to the next line, while println() displays output and then moves the cursor to a new line.

7. Can variables be used in arithmetic expressions?

What I understood first

Yes.

This is one of the main reasons variables are useful.

Instead of writing values directly into every calculation, I can store them in variables and then use those variables in expressions.

For example:

int num1 = 3;
int num2 = 5;

System.out.println(num1 + num2);
Enter fullscreen mode Exit fullscreen mode

The output is:

8
Enter fullscreen mode Exit fullscreen mode

What actually happens?

The expression:

num1 + num2
Enter fullscreen mode Exit fullscreen mode

uses the values currently stored in those variables.

Conceptually:

num1 → 3
num2 → 5

3 + 5
 ↓
 8
Enter fullscreen mode Exit fullscreen mode

Then System.out.println() prints the result.

Other arithmetic operations

Variables can also be used with operators such as:

+
-
*
/
%
Enter fullscreen mode Exit fullscreen mode

For example:

int a = 10;
int b = 3;

System.out.println(a + b);
System.out.println(a - b);
System.out.println(a * b);
System.out.println(a / b);
System.out.println(a % b);
Enter fullscreen mode Exit fullscreen mode

The exact behavior of operations such as integer division and remainder becomes more important as I learn Java's numeric types.

Why use variables instead of values directly?

Compare:

System.out.println(3 + 5);
Enter fullscreen mode Exit fullscreen mode

with:

int num1 = 3;
int num2 = 5;

System.out.println(num1 + num2);
Enter fullscreen mode Exit fullscreen mode

The second version is more meaningful when the values represent real data.

For example:

int price = 500;
int discount = 100;

System.out.println(price - discount);
Enter fullscreen mode Exit fullscreen mode

Now the code communicates what the numbers mean.

🧠 Easy to Remember

Variables can participate in expressions just like values can.

Think:

Variable → stored value → expression → result
Enter fullscreen mode Exit fullscreen mode

🎯 Short Interview Answer

Yes. Variables can be used in arithmetic expressions. Java uses the values currently stored in the variables when evaluating the expression.

8. Why store an intermediate result in another variable?

What I understood first

Suppose I have:

int num1 = 3;
int num2 = 5;

System.out.println(num1 + num2);
Enter fullscreen mode Exit fullscreen mode

This works perfectly.

But I can also write:

int num1 = 3;
int num2 = 5;

int result = num1 + num2;

System.out.println(result);
Enter fullscreen mode Exit fullscreen mode

At first, I wondered:

Why create another variable when I can print the calculation directly?

The answer is that storing the result gives the value a name.

Direct calculation

System.out.println(num1 + num2);
Enter fullscreen mode Exit fullscreen mode

The calculation happens and the result is immediately printed.

Store the result

int result = num1 + num2;

System.out.println(result);
Enter fullscreen mode Exit fullscreen mode

Now the calculation and output are separate.

Conceptually:

Input values
    ↓
Calculation
    ↓
Result variable
    ↓
Output
Enter fullscreen mode Exit fullscreen mode

Why is this useful?

In a small example, it may not seem necessary.

But imagine a larger program where I need to use the result several times.

For example:

int price = 500;
int discount = 100;

int finalPrice = price - discount;
Enter fullscreen mode Exit fullscreen mode

Now finalPrice can be used in multiple places:

System.out.println(finalPrice);
Enter fullscreen mode Exit fullscreen mode

or:

// use finalPrice in another calculation
Enter fullscreen mode Exit fullscreen mode

The variable also makes the code easier to understand.

Compare:

System.out.println(price - discount);
Enter fullscreen mode Exit fullscreen mode

with:

int finalPrice = price - discount;
System.out.println(finalPrice);
Enter fullscreen mode Exit fullscreen mode

The second version tells me what the result actually represents.

Intermediate results in larger programs

Real applications often perform multiple steps:

Input
 ↓
Process
 ↓
Intermediate result
 ↓
More processing
 ↓
Final result
Enter fullscreen mode Exit fullscreen mode

Variables make it possible to store those intermediate values.

This becomes extremely important as programs become more complex.

🧠 Easy to Remember

Store a result in a variable when you need to reuse it, name it, or make the calculation easier to understand.

Think:

Input → Calculation → Result variable → Output
Enter fullscreen mode Exit fullscreen mode

🎯 Short Interview Answer

An intermediate result can be stored in another variable so that it can be reused, given a meaningful name, or used in later calculations. It can also improve code readability.

💾 Why Applications Work With Data

What I understood from the lesson

Almost every useful application works with data.

For example:

  • A banking application works with account information and transactions.
  • An e-commerce application works with products and orders.
  • A student application works with names, marks, and attendance.
  • A social-media application works with users, posts, comments, and messages.

A simplified view is:

```text id="7h5f3w"
Input

Processing

Storage




Data may come from:

* Users
* Files
* APIs
* Databases
* Sensors
* Other applications

The program processes that data and produces some result.

### Persistent vs temporary data

This is where the database vs variable distinction becomes useful.

A database is generally used for **persistent storage**.

A variable is generally used as **temporary working storage during program execution**.

For example:



```text id="s4ppx4"
Database
   ↓
Retrieve user balance
   ↓
Variable
   ↓
Perform calculation
   ↓
Updated value
   ↓
Database
Enter fullscreen mode Exit fullscreen mode

So variables and databases solve different problems.


✏️ Java Statements and Semicolons

What I understood first

I noticed that many Java statements end with:

;
Enter fullscreen mode Exit fullscreen mode

For example:

int num = 3;
Enter fullscreen mode Exit fullscreen mode

The semicolon marks the end of a Java statement.

Example

int num = 3;
System.out.println(num);
Enter fullscreen mode Exit fullscreen mode

Both are statements, and both end with semicolons.

What about curly braces?

Curly braces define blocks of code.

For example:

{
    int num = 3;
    System.out.println(num);
}
Enter fullscreen mode Exit fullscreen mode

The braces themselves are not simply "another kind of semicolon."

They define a block containing statements.

This distinction becomes much more important when I learn:

  • Classes
  • Methods
  • if
  • else
  • Loops

🧠 Easy to Remember

; → ends a statement

{ } → defines a block

🔄 Compile Again After Changing Code

What I understood from this lesson

This is an easy mistake to make when starting out.

Suppose I write:

System.out.println("Hello");
Enter fullscreen mode Exit fullscreen mode

Then compile:

javac Hello.java
Enter fullscreen mode Exit fullscreen mode

and run:

java Hello
Enter fullscreen mode Exit fullscreen mode

I get:

Hello
Enter fullscreen mode Exit fullscreen mode

Now I change the source code:

System.out.println("Hello Java");
Enter fullscreen mode Exit fullscreen mode

If I immediately run the old compiled class without compiling the changed source again, I may still see the previous output.

That's because the .class file hasn't been updated.

The correct workflow

After changing the source:

```text id="k4t8ve"
Edit

Save

Compile

Run




For example:



```bash
javac Hello.java
java Hello
Enter fullscreen mode Exit fullscreen mode

🧠 Easy to Remember

Changed .java → compile again before running

Think:

Edit → Compile → Run
Enter fullscreen mode Exit fullscreen mode

⚠️ Common Beginner Mistakes

Declaring a variable without a type

Incorrect:

num = 3;
Enter fullscreen mode Exit fullscreen mode

At this stage, Java expects a declaration such as:

int num = 3;
Enter fullscreen mode Exit fullscreen mode

Trying to store a decimal in int

Incorrect:

int price = 6.5;
Enter fullscreen mode Exit fullscreen mode

6.5 is not an integer.

Forgetting the semicolon

Incorrect:

int num = 3
Enter fullscreen mode Exit fullscreen mode

Correct:

int num = 3;
Enter fullscreen mode Exit fullscreen mode

Confusing = with comparison

Remember:

=  → assignment
== → equality comparison
Enter fullscreen mode Exit fullscreen mode

Forgetting to recompile

If I modify:

Hello.java
Enter fullscreen mode Exit fullscreen mode

I should compile again before running the updated program.

Using print() when I need separate lines

This:

System.out.print(5);
System.out.print(15);
Enter fullscreen mode Exit fullscreen mode

produces:

515
Enter fullscreen mode Exit fullscreen mode

while:

System.out.println(5);
System.out.println(15);
Enter fullscreen mode Exit fullscreen mode

produces:

5
15
Enter fullscreen mode Exit fullscreen mode

🧠 One-Minute Revision Sheet

If I need to revise this lesson quickly, this is what I want to remember:

Variable
↓
Named storage for a value

Java
↓
Strongly typed

String
↓
Text

int
↓
Integer / whole number

=
↓
Assignment

;
↓
End of statement

print()
↓
Same line

println()
↓
New line

Variables
↓
Can be used in expressions

Intermediate result
↓
Store calculation in another variable

After editing
↓
Compile again
↓
Run
Enter fullscreen mode Exit fullscreen mode

And the basic variable pattern is:

type variableName = value;
Enter fullscreen mode Exit fullscreen mode

For example:

int num = 3;
Enter fullscreen mode Exit fullscreen mode

🎯 8 Interview Questions — Super Short Answers

What is a variable?

A variable is a named storage location used to hold a value during program execution.

Why does Java require a variable type?

Java is strongly typed, so a variable declaration specifies the kind of data the variable is intended to store.

What does int mean?

int is a primitive data type used to store integer or whole-number values.

What is String used for?

String is used to represent text or a sequence of characters.

What does = do?

= is the assignment operator. It assigns the value of the right-hand expression to the variable on the left.

What is the difference between print() and println()?

print() stays on the same line, while println() moves to a new line after printing.

Can variables be used in arithmetic expressions?

Yes. Java uses the values currently stored in variables when evaluating arithmetic expressions.

Why store an intermediate result?

To give the result a meaningful name, reuse it later, or make the program easier to understand.

What I Learned From This Lesson

This lesson changed how I looked at a simple statement like:

int num = 3;
Enter fullscreen mode Exit fullscreen mode

Before, I saw it as just one line of Java code.

Now I can break it down:

int
 ↓
What kind of data?

num
 ↓
What is the variable called?

=
 ↓
Assign the value

3
 ↓
What value should it hold?

;
 ↓
Statement is complete
Enter fullscreen mode Exit fullscreen mode

That small line contains several important programming concepts.

I also started seeing the relationship between data and processing more clearly:

Input
 ↓
Variables
 ↓
Processing
 ↓
Intermediate Results
 ↓
Output
Enter fullscreen mode Exit fullscreen mode

And that is essentially what many programs do at a basic level.

A Note for Other Beginners

If variables feel confusing at first, don't try to memorize every data type immediately.

Start with the basic idea:

A variable is a named place where a program can temporarily store data.

Then learn the pattern:

type variableName = value;
Enter fullscreen mode Exit fullscreen mode

For example:

int age = 22;
String name = "Poushmita";
Enter fullscreen mode Exit fullscreen mode

Once this pattern becomes familiar, other data types and more complex expressions become much easier to understand.

Also remember that:

=
Enter fullscreen mode Exit fullscreen mode

means assignment.

It does not mean comparison.

And whenever you change your Java source code:

Edit → Save → Compile → Run
Enter fullscreen mode Exit fullscreen mode

That small workflow will save a lot of confusion when you're starting.

📚 Related Java Learning Resources

This article is part of my Java Learning Notes — Telusko Core Java series.

If you are following the series from the beginning:

👉 Video 01 — Java Introduction: 8 Questions I Had as a Beginner and Their Easy Answers

👉 Video 02 — Setting Up Java: 6 Questions I Had About JDK, VS Code, LTS and PATH

👉 Video 03 — Writing Your First Java Code: 5 Questions I Had as a Beginner

If you have also covered the JVM/JRE/JDK lesson, add that article here as well:

👉 Video 04 — JVM, JRE and JDK

🔗 My Java Learning Notes

I am maintaining the complete structured notes and resources in my GitHub repository.

👉 Java Learning Notes — Telusko Core Java

The GitHub repository contains my concise learning notes and resources, while these DEV.to articles go deeper into the questions and concepts that I found confusing during my learning.

Final Takeaway

For me, this lesson made the idea of data inside a program much clearer.

The simple mental model I want to remember is:

Data
 ↓
Variable
 ↓
Processing
 ↓
Result
 ↓
Output
Enter fullscreen mode Exit fullscreen mode

And the basic Java syntax:

int num = 3;
Enter fullscreen mode Exit fullscreen mode

can be understood as:

int
→ type

num
→ variable name

=
→ assignment

3
→ value

;
→ end of statement
Enter fullscreen mode Exit fullscreen mode

The most important things I want to remember from this lesson are:

Variable → named storage

String → text

int → integer

= → assignment

print() → same line

println() → new line

Edit → Compile → Run

These are small concepts, but they form the foundation for much more advanced Java programming.

And now that I understand how Java stores and processes basic data, the next step is to learn more about the different data types Java provides and how they behave.


This is part of my ongoing Java learning journey. I'm documenting what I learn, the questions I get stuck on, and the explanations that finally make the concepts click for me — hopefully they can help another beginner too.

Top comments (0)