#22 Class and Object Practical in Java

preview_player
Показать описание
Check out our courses:

Coupon: TELUSKO10 (10% Discount)

Coupon: TELUSKO20 (20% Discount)

For More Queries WhatsApp or Call on : +919008963671

Udemy Courses:

In this lecture we will learn:
- Class in Java
- Syntax of class in Java
- Creation of objects in Java
- Methods in Java

#1
Whatever we do in Java, we do it in a class.
A class is a user-defined blueprint or prototype from which objects are created.
- In a class, we have methods and variables.
- Class will be created in the same java file.
- We can create any number of classes in a program.
- Class does not occupy memory.
Syntax of a class:-
class classname
{
methods, variables
}

#2
- Every object has two things: properties and methods.
- When an object of a class is created, the class is said to be instantiated. All the instances share the attributes and the behavior of the class.
- Action will be done with the help of methods.
- We need to specify the access to methods. We will specify it as public if we want it to be called from anywhere else.
- If we want the method to return any value then we need to specify its return type like int for Integer type values.
- As Java is a statically typed language so you have to specify the return type in it.

Syntax of method:-
= access modifier return type method name()
public int add()
{
statement;
}

#3
- We need an object to call a method from a different class.
- Creating an object:-
classname reference variable= new classname();
- reference variable is used to tell that this variable is made to establish a reference between a class.
- new keyword is used to tell that we have to utilise the space for an object.

- We can call a method by using the reference variable of the object.
- We have to pass the values if we want some operations to be on them.
- We also have to accept values in a method as well if we pass some values. For this, we have to specify parameters in a method based on the type of passed values.

More Learning :

Donation:
PayPal Id : navinreddy20
Рекомендации по теме
Комментарии
Автор

Telusko, this video is brillant! NO ONE has been able to articulate this to me in such a clear way. I wish I had found this video YEARS ago. 🙏 Your channel is pure🔥!

benjaminJohn
Автор

I really appreciate you took the time to actually explain why the syntax works the way they are unlike others who just tell us
do this
Calculator obj = new Calculator();
and not explain what each is and does

mosshead_vinsmoke
Автор

Good but difficult for the beginners to understand the depth of your explanation!

nareshgajula
Автор

Hey vera level bro 🎉 i can understand concepts very well it's my third days of java coding journey, i continuously watching your tutorial and i follow ur tutorial only🎉.thank you 🎉🎉

MuthuAnushya
Автор

Hey TELUSKO, this was my first comment on YouTube because I was such an introvert to even make a comment, The way you teach I admire a lot and this video is incredible and it paves me to think of exploring all your courses!!!! Thanks again Telusko !!

aishwaryab
Автор

probably the best java teacher in the world

rohithvarma
Автор

I don't know how I can express myself. We did objects with my lecturer but I did not understand what he was saying until I found this video. You are a redeemer. ❤

chinyamaraphael-spwt
Автор

sir you are the best teacher sir plzz create a new series on jsp and servlet

-ritikjain
Автор

your all videos is excellent! i wish i had found this collection years ago.❤

rahulmansarowar
Автор

Congratulation you made java so easy in this short concept of object and class in java💯

uqyxwlu
Автор

You are an amazing instructor. It’s not just how to write the code but why to do it certain way.. brilliant..

prasantdas
Автор

00:05 In this video, we learned about classes and objects in Java.
01:57 Design your objects by separating manufacturing and designing
03:49 Methods in Java must specify access and return type
05:39 Designing a class with a variable and a method
07:35 To create an object, you need to specify the type and use the 'new' keyword.
09:40 How to create an object in Java
11:47 Create a variable called R and assign the sum of num1 and num2 to it
13:42 The video discusses how to create a class in Java and use it to add two values.

shaikmansoor
Автор

Never been this much easy. Hatts off bro .

chichhasquad
Автор

it was an excellent explanation. Very understandable to beginners.

wgudhhn
Автор

It was easy in Python, but unable to understand in Java.

Shubham-fkis
Автор

absolutely best tutorials about Java! thanks:)

fezaiozcan
Автор

literally Legend ! I've purchased a paid course but i learn more there

himanshu
Автор

Hi, Thanks a lot for excellent explanation, very understandable to beginners, I'm learning java for automation selenium with your video.💯

akankshamishra
Автор

why are we using diffrent classes for adding where it can be done easily in one class only??? why to complicate things???

and also did not understand anything rest all the videos were superb but i dont know why

kanushagrawal
Автор

can't find main(String[]) method in class-How to solve the issue.Pls comment sir.

RK_Universe