new class

This commit is contained in:
Geir Okkenhaug Jerstad 2024-11-13 15:40:05 +01:00
parent 7339ce877e
commit 343a9bc318
2 changed files with 28 additions and 1 deletions

View file

@ -0,0 +1,24 @@
namespace ConsoleApp2;
public class NewClass
{
private int tall = 1;
private float desimalTall = 1.0f;
double desimalTall2 = 1.01;
decimal desimalTall3 = 1.01M;
char bokstav = 'A';
string tekst = "Hei";
bool santUsant = true; //eller false
int[] tallArray = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
string[] tekstArray = { "A", "B", "C", "D", "E" };
List<int> ListeMedTall = new List<int>();
public int NumberFive()
{
return 5;
}
}

View file

@ -4,7 +4,10 @@ internal class Program
{ {
static void Main(string[] args) static void Main(string[] args)
{ {
Console.WriteLine("Hello World!"); Console.WriteLine("Hei, hva heter du?");
var input = Console.ReadLine();
Console.WriteLine($"Velkommen {input}!");
Console.WriteLine(NewClass.bokstav);
} }
} }