C# array of objects 🏬

  Рет қаралды 34,976

Bro Code

Bro Code

Күн бұрын

Пікірлер: 26
@BroCodez
@BroCodez 3 жыл бұрын
using System; namespace MyFirstProgram { class Program { static void Main(string[] args) { Car[] garage = { new Car("Mustang"), new Car("Corvette"), new Car("Lambo") }; foreach (Car car in garage) { Console.WriteLine(car.model); } Console.ReadKey(); } } class Car { public String model; public Car(String model) { this.model = model; } } }
@ValoranVale
@ValoranVale 3 жыл бұрын
Thank you. It's surprisingly difficult to find concise, well explained information about something that has been around for so long.
@sarccacious
@sarccacious 4 ай бұрын
Im looking to do a deck of cards. I assume instead of Car you would use Card, and instead of garage you would use Deck. My question is how do i get an int and a string per object and fit them in an array. Lastly, how do I shuffle them?
@spartanranger
@spartanranger 3 жыл бұрын
Thanks for the video Bro.
@budderrar5751
@budderrar5751 2 жыл бұрын
noice
@stefanlazov2888
@stefanlazov2888 2 жыл бұрын
хайст
@neuronerd5211
@neuronerd5211 2 жыл бұрын
I'll just hand you my tuition....:)
@DetCoAnimeFan
@DetCoAnimeFan 3 жыл бұрын
Bro code delivering quality content on C#, I would love this to go upto GUI. BTW I wanted your opinion, how much do you think C# is similar to java and which is better?
@aditya_asundi
@aditya_asundi 3 жыл бұрын
yes. c# is very much similar to java. but i don't think you can compare c# with java. it's like asking whether you like a saw or a screwdriver. c# and java may be similar in syntax but are used for different purposes. c# is mostly used to make gui apps and 3d/2d games. java is used in web backend and in android development, and jetbrains makes its ide's with java.
@DetCoAnimeFan
@DetCoAnimeFan 3 жыл бұрын
@@aditya_asundi Ohh, well I am learning swing and fx in java. I want to use C# for game development. Thanks for recommendation.
@engirckt5410
@engirckt5410 3 жыл бұрын
@@DetCoAnimeFan after c# i wanna learn java, i wanna mod minecraft :D
@DetCoAnimeFan
@DetCoAnimeFan 3 жыл бұрын
@@engirckt5410 Java is very similar to java, I have learnt almost the entire playlist of his
@DetCoAnimeFan
@DetCoAnimeFan 3 жыл бұрын
@MToiletTerrorist I want to do both game development and app development.
@Proviper666
@Proviper666 2 жыл бұрын
#Car
@triton5457
@triton5457 2 жыл бұрын
bro is pro
@janisvirsnitis8312
@janisvirsnitis8312 Жыл бұрын
:)
@LucParent905
@LucParent905 3 жыл бұрын
Thanks
@sajid_inamdar3692
@sajid_inamdar3692 2 жыл бұрын
How many objects are being created ? Is it 1 or 3?
@MoHaTa-u3f
@MoHaTa-u3f 2 ай бұрын
So basically an array of objects is like a normal array, but instead of listing the datatype (String), you list the object class (Car)
@forward8204
@forward8204 3 жыл бұрын
and what if i want to create an array with unlimited space? thats i just push numbers into him
@derpyherpy3773
@derpyherpy3773 Жыл бұрын
seconding this, anyone found a solution to that?
@salar1997
@salar1997 Жыл бұрын
@@derpyherpy3773 class Program { static void Main(string[] args) { List cars = new List(); cars.Add(new Car("Mustang")); cars.Add(new Car("Mustang")); cars.Add(new Car("Mustang")); cars.Add(new Car("Mustang")); foreach (var car in cars) { Console.WriteLine(car.Model); } } class Car { public string Model { get; } public Car(string model) { this.Model = model; } } }
3 жыл бұрын
Thanks Bro!
@whitedinamo
@whitedinamo 2 жыл бұрын
lesson check😇
@the_dude_josh
@the_dude_josh Жыл бұрын
A random comment down below.
@justnomore5975
@justnomore5975 2 жыл бұрын
//random
C# objects as arguments 🧳
4:18
Bro Code
Рет қаралды 20 М.
C# polymorphism 🎭
5:11
Bro Code
Рет қаралды 89 М.
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
you will never ask about pointers again after watching this video
8:03
IS303 C# OOP #2 Array of Objects
9:53
Greg Anderson
Рет қаралды 11 М.
C# arrays 🚗
5:57
Bro Code
Рет қаралды 68 М.
Array vs. ArrayList in Java Tutorial - What's The Difference?
17:36
Coding with John
Рет қаралды 569 М.
Classes & Objects | C# | Tutorial 25
13:25
Giraffe Academy
Рет қаралды 178 М.
The Absolute Best Intro to Monads For Software Engineers
15:12
Studying With Alex
Рет қаралды 676 М.
Python dataclasses will save you HOURS, also featuring attrs
8:50
How to Program in C# - Arrays (E05)
17:01
Brackeys
Рет қаралды 450 М.
Learn C# for beginners: 33 -  Using Loops with Arrays
16:53
Jesse Dietrichson
Рет қаралды 17 М.