Java Class Vlog β Session 3
Hey everyone! π Welcome to my Java learning journey. Today was our third session of Java class, and trust me, itβs getting really exciting! Let me take you through what we learned today!!
Starting the Class
Our trainer kicked things off by asking us what we remembered from the last two sessions. A quick recap of Java basics and then we jumped straight into todayβs topics: Classes, Keywords, Variables, and Methods.
Topic 1: What is a Class?
The teacher explained that a class is like a blueprint. Itβs not the actual object but a plan for making one. Example? Think of a mobile phone model β the design is the class, but the actual phone in your hand is the object.
We also saw the syntax:
public class Classname {
// variables
// methods
}
I found it super cool that once you define a class, you can create as many objects as you want from it.
π Topic 2: Keywords
Then we talked about keywords. These are reserved words in Java that you cannot use as names. For example: class, public, static, void, etc.
Our teacher joked, βIf Java was a city, keywords are the traffic rules you canβt break.β
π Topic 3: Variables and Their Types
Next up: Variables! These are like containers that hold values. We wrote a few examples like:
int age = 20;
String name = "John";
We also learned about the three types of variables:
Local Variable β Lives inside a method.
Instance Variable β Belongs to each object.
This part made me realize how powerful Java is in handling data.
π Topic 4: Methods
Finally, we learned about methods β blocks of code that perform actions. There are four types:
Without return type
With return type
Without argument
With arguments
We even practiced writing a few of them. It felt like I was giving instructions to the computer and it actually followed them β so satisfying!
π― End of the Session
The class wrapped up with a quick summary. I left the session feeling more confident β Java is starting to make sense now!!
Top comments (0)