asd
This commit is contained in:
50
20241115/demo.cs
Normal file
50
20241115/demo.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
//using System.Threading.Tasks;
|
||||
|
||||
namespace ConsoleApp1
|
||||
{
|
||||
class Demo{
|
||||
public string Szoveg{get;set;}
|
||||
public int Szam{get;set;}
|
||||
|
||||
public Demo(){
|
||||
Szoveg = "";
|
||||
Szam = -1;
|
||||
}
|
||||
|
||||
public Demo(string szoveg, int szam){
|
||||
Szoveg = szoveg;
|
||||
Szam = szam;
|
||||
}
|
||||
}
|
||||
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
var tomb = new Demo[4];
|
||||
tomb[0] = new Demo("Teszt", 42);
|
||||
|
||||
tomb[3] = new Demo(){
|
||||
Szoveg = "Masik",
|
||||
Szam = 11
|
||||
};
|
||||
|
||||
foreach (var item in tomb)
|
||||
{
|
||||
if (item == null){
|
||||
Console.WriteLine("null");
|
||||
} else{
|
||||
Console.WriteLine("{0} {1}", item.Szoveg, item.Szam);
|
||||
}
|
||||
}
|
||||
|
||||
Console.ReadLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user