Java object passing 🏬

preview_player
Показать описание
Java pass objects as arguments parameters

#Java #object #pass #arguments #parameters
Рекомендации по теме
Комментарии
Автор


public class Main {

public static void main(String[] args) {

Garage garage = new Garage();

Car car1 = new Car("BMW");
Car car2 = new Car("Tesla");

garage.park(car1);
garage.park(car2);

}
}

public class Garage {


void park(Car car) {
System.out.println("The "+car.name+" is parked in the garage");
}

public class Car {


String name;

Car(String name){
this.name = name;
}


BroCodez
Автор

What a brilliant way of teaching code! I'm not good at English but I can understand almost what you say in video! Thank you so much!

HuyNguyen-qxjr
Автор

I really appreciate your brilliant way of teaching. It was awsome ;)

programminglover
Автор

Man, at first, i just wanted to learn java to make minecraft mods. After watching your videos, now i want to learn other languages too. You are great, much love ❤

kemann
Автор

great video!!! I'm infinitely grateful for your dedication and big heart to share this knowledge with the world. Thank you soo much

dianamilenaarchilacordoba
Автор

Thanks Bro for this Series, i'm a Python Guy, but i'm enjoying getting the info again for Java

TechWithSabri
Автор

enjoying this java tutorial, hoping for project based tutorial for java☺️☺️☺️

millejadecabrera
Автор

Please do the road map, what to study in JAVA to get a job. Thank you so much

iamTHIEN
Автор

Bro code is incredible. So fun and easy to learn. I am a self learner. So far I feel that I do not need anyone help to learn Java 😂😂. Bro is more than enough. ❤. To point and short & all necessary explanations

deeplife
Автор

This is the best Java tutorial for beginners, so you can learn Java and English in one hit. Please keep going! I vote for Java advance tutorial. Thanks a lot Bro

pavelkvasnicka
Автор

my friend, will you ever teach spring ? java for web. I'm willing to pay you for a course like that. create a patreon !

anatolisavin
Автор

Easy to understand this is what i need 👍

stevenadisantoso
Автор

how do you only have 11k subs I've recommended you to like every new coder I know

nikleduc
Автор

Do you happen to have a discord by any chance? would be really helpful to get help on more specific problems! Other wise amazing videos!

DudeWhoGames
Автор

Object passing

Passing an object as an argument to a method

public class Main
{
public static void main(String[] args) {

Warehouse warehouse = new Warehouse();

Commodity commodity1 = new Commodity("corn");
Commodity commodity2 = new Commodity("soya bean");



}
}



public class Warehouse{


void stock(Commodity commodity){

System.out.println("The "+commodity.article+" is stocked in the warehouse");
}

}



public class Commodity{

String article;

Commodity(String article){
this.article = article;
}
}

joyceasante
Автор

If you had a second method in garage to park motorcycles, you would have it call a motorcycle object as well but both would exist within garage, correct?

JFErikson
Автор

nice explanation.
Thanks for the videos.

BalaKumaran-gj
Автор

you are the absolute best bro. i love you bro

lmao
Автор

this may seem weird I love how you put a symbol or picture after your title!!

tamekkaknuth
Автор

Understood with using integers. 32th. Thank you, ma Bro Sensei!

honoredegg