#22 Class and Object Practical in Java

  Рет қаралды 202,871

Telusko

Telusko

Жыл бұрын

Check out our courses:
Spring and Microservices Weekend Live Batch : bit.ly/spring-live-weekend
Coupon: TELUSKO10 (10% Discount)
Master Java Spring Development : bit.ly/java-spring-cloud
Udemy Courses:
Java:- bit.ly/JavaUdemyTelusko
Spring:- bit.ly/SpringUdemyTelusko
Java For Programmers:- bit.ly/javaProgrammers
For More Queries WhatsApp or Call on : +919008963671
website : courses.telusko.com/
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.
Java:- bit.ly/JavaUdemyTelusko
Spring:- bit.ly/SpringUdemyTelusko
More Learning :
Java :- bit.ly/3x6rr0N
Python :- bit.ly/3GRc7JX
Django :- bit.ly/3MmoJK6
JavaScript :- bit.ly/3tiAlHo
Node JS :- bit.ly/3GT4liq
Rest Api :-bit.ly/3MjhZwt
Servlet :- bit.ly/3Q7eA7k
Spring Framework :- bit.ly/3xi7buh
Design Patterns in Java :- bit.ly/3MocXiq
Docker :- bit.ly/3xjWzLA
Blockchain Tutorial :- bit.ly/3NSbOkc
Corda Tutorial:- bit.ly/3thbUKa
Hyperledger Fabric :- bit.ly/38RZCRB
NoSQL Tutorial :- bit.ly/3aJpRuc
Mysql Tutorial :- bit.ly/3thpr4L
Data Structures using Java :- bit.ly/3MuJa7S
Git Tutorial :- bit.ly/3NXyCPu
Donation:
PayPal Id : navinreddy20
www.telusko.com

Пікірлер: 60
@user-benjaminJohn
@user-benjaminJohn 9 ай бұрын
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🔥!
@032-m.muthuanushya2
@032-m.muthuanushya2 7 ай бұрын
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 🎉🎉
@nareshgajula
@nareshgajula 8 ай бұрын
Good but difficult for the beginners to understand the depth of your explanation!
@fezaiozcan2227
@fezaiozcan2227 11 ай бұрын
absolutely best tutorials about Java! thanks:)
@prasantdas587
@prasantdas587 3 ай бұрын
You are an amazing instructor. It’s not just how to write the code but why to do it certain way.. brilliant..
@91-ritikjain36
@91-ritikjain36 Жыл бұрын
sir you are the best teacher sir plzz create a new series on jsp and servlet
@user-uq5yx4wl4u
@user-uq5yx4wl4u 6 ай бұрын
Congratulation you made java so easy in this short concept of object and class in java💯
@akankshamishra1262
@akankshamishra1262 6 ай бұрын
Hi, Thanks a lot for excellent explanation, very understandable to beginners, I'm learning java for automation selenium with your video.💯
@mango-strawberry
@mango-strawberry Жыл бұрын
Literally perfect explanation
@user-wg6ud3hh1n
@user-wg6ud3hh1n 7 ай бұрын
it was an excellent explanation. Very understandable to beginners.
@rohithvarma6763
@rohithvarma6763 5 ай бұрын
probably the best java teacher in the world
@Trunk_Tech
@Trunk_Tech Жыл бұрын
Am enjoying every bit of these lessons......Kudos
@chichhasquad2342
@chichhasquad2342 4 ай бұрын
Never been this much easy. Hatts off bro .
@Shubham-fk4is
@Shubham-fk4is Жыл бұрын
It was easy in Python, but unable to understand in Java.
@aishwaryab673
@aishwaryab673 3 ай бұрын
Hey TELUSKO, this was my first comment on KZfaq 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 !!
@shaikmansoor223
@shaikmansoor223 5 ай бұрын
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.
@chinyamaraphael-sp6wt
@chinyamaraphael-sp6wt 2 ай бұрын
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. ❤
@yitingchen8278
@yitingchen8278 Жыл бұрын
Good explanation!
@bandarisailikhitha9865
@bandarisailikhitha9865 6 ай бұрын
Thanks navin, you are awesome
@photolab6712
@photolab6712 7 ай бұрын
superb lecture...
@shobhashobha2614
@shobhashobha2614 5 ай бұрын
Hi sir Which language is best for preparing dsa?
@agilan1546
@agilan1546 7 ай бұрын
Why are we creating a variable int a in the calculator class?
@RK_Universe
@RK_Universe 4 ай бұрын
can't find main(String[]) method in class-How to solve the issue.Pls comment sir.
@shandeshchaudhary-ps1tz
@shandeshchaudhary-ps1tz 5 ай бұрын
you are the best man
@chaitanyathorat8429
@chaitanyathorat8429 Жыл бұрын
Perfectooo👌👌
@pydisettymahesh9655
@pydisettymahesh9655 6 ай бұрын
it is an exaple of inheritance
@nandasiddiksha5534
@nandasiddiksha5534 Жыл бұрын
how to get user input?? Instead of assigning values to variables..
@__sam_danielW
@__sam_danielW Жыл бұрын
We have to import scanner so that we can get the input from the user
@darshilchitranshi592
@darshilchitranshi592 5 ай бұрын
14:21 summmary
@pinkeykumari1312
@pinkeykumari1312 4 ай бұрын
my java file created but class not loaded then what to do?
@gugulothusaritha1221
@gugulothusaritha1221 Жыл бұрын
sir,Increase the font size
@ourera2279
@ourera2279 2 ай бұрын
does anyone know where are the pratice questions for these ?
@nprince411
@nprince411 5 ай бұрын
tqs sir
@abishekathangaselvam6673
@abishekathangaselvam6673 7 ай бұрын
First time i am disappointed with ur series,actually u r confusing and still now not told about getting inputs very disappointed sie
@hrishikeshmukherjee813
@hrishikeshmukherjee813 Жыл бұрын
Super
@sonaligaikwad-zo5ds
@sonaligaikwad-zo5ds 29 күн бұрын
But in calculator class main method is not declare
@kanushagrawal7192
@kanushagrawal7192 2 ай бұрын
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
@arashgh7461
@arashgh7461 Жыл бұрын
Thanks for that. i have a project in java will you help me on that payable
@The_Shrock69
@The_Shrock69 7 ай бұрын
Bro😂
@tekkishort9018
@tekkishort9018 6 ай бұрын
U need to redo this part all parts were clear and concise until this video it's very bad redo it
@timsy4401
@timsy4401 10 ай бұрын
this video is not much clear
@AnuragRawat01
@AnuragRawat01 11 ай бұрын
Thank u so much 💯❤️
@rutulkarbhari4963
@rutulkarbhari4963 10 ай бұрын
not working for me even if I have the same codes as you. Giving - error: can't find the main(String[]) method in class: Calculator. Solution?
@naveenrajanaveen6462
@naveenrajanaveen6462 10 ай бұрын
Put (String args[]) instead of (String []) You want to give a name like args, abc, etc..
@rutulkarbhari4963
@rutulkarbhari4963 10 ай бұрын
@@naveenrajanaveen6462 was helpful. And i also wanted to thank you sir🙏.
@miethrayan
@miethrayan 10 ай бұрын
​@@naveenrajanaveen6462 but it shows error in main method
@alex__coder
@alex__coder 9 ай бұрын
define calculator class after the hello class, then it will work fine@@miethrayan
@kirubasathish3683
@kirubasathish3683 Жыл бұрын
sir we can add the number like this also sir? class Calculator{ int a; public int add() { System.out.println("add"); return 12 + 12; } } public class java1 { public static void main(String a[]) { Calculator calc = new Calculator(); int result = calc.add(); //int result = num1 + num2; System.out.println(result); } } and good explanation sir
@kartheekk2380
@kartheekk2380 11 ай бұрын
can you please explain 2nd line why we have to mention int a; please
@hellohell143
@hellohell143 11 ай бұрын
​​​​@@kartheekk2380bro we are not using a he just shows how to declaration a data type in class
@malvikaambastasquestx5965
@malvikaambastasquestx5965 10 ай бұрын
Yes, this will work.
@malvikaambastasquestx5965
@malvikaambastasquestx5965 10 ай бұрын
@@kartheekk2380We don’t need to put it. Not compulsory.
@manojm1853
@manojm1853 4 ай бұрын
2:57 my iPhone says the same
@rohitn6063
@rohitn6063 3 ай бұрын
14:37
@divakarpareek9466
@divakarpareek9466 8 ай бұрын
@telusko -- I must say your previous Java series of 6 hrs was much better then this one. I have come to 22nd video, in almost each video you are struggling to put clear example and changing in between that's frustating . It should be pre prepared.
@abdulbasith3818
@abdulbasith3818 8 ай бұрын
Can you pls mention that vedio
@abdulbasith3818
@abdulbasith3818 8 ай бұрын
For me it is little bit tuff
@sheiduwgwjd
@sheiduwgwjd 2 ай бұрын
Confusing
@RamgiriRachaRayudu
@RamgiriRachaRayudu 3 ай бұрын
🥳
@rockybalboa6969
@rockybalboa6969 7 ай бұрын
14:21 summmary
#23 JDK JRE JVM in Java
5:22
Telusko
Рет қаралды 210 М.
Generics In Java - Full Simple Tutorial
17:34
Coding with John
Рет қаралды 1 МЛН
DO YOU HAVE FRIENDS LIKE THIS?
00:17
dednahype
Рет қаралды 104 МЛН
Heartwarming: Stranger Saves Puppy from Hot Car #shorts
00:22
Fabiosa Best Lifehacks
Рет қаралды 22 МЛН
아이스크림으로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 56 МЛН
#24 Methods in Java
11:30
Telusko
Рет қаралды 186 М.
Java Classes & Objects
11:36
Keep On Coding
Рет қаралды 306 М.
#26 Stack And Heap in Java
12:37
Telusko
Рет қаралды 209 М.
#53 Packages in Java
12:20
Telusko
Рет қаралды 164 М.
#21 Class And Object Theory in Java
5:48
Telusko
Рет қаралды 196 М.
#65 Need of Interface in Java
8:32
Telusko
Рет қаралды 113 М.
#25 Method Overloading in Java
6:03
Telusko
Рет қаралды 167 М.
Todos os modelos de smartphone
0:20
Spider Slack
Рет қаралды 32 МЛН
Choose a phone for your mom
0:20
ChooseGift
Рет қаралды 7 МЛН
Телефон-електрошокер
0:43
RICARDO 2.0
Рет қаралды 197 М.
Easy Art with AR Drawing App - Step by step for Beginners
0:27
Melli Art School
Рет қаралды 14 МЛН