//Skip to content
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
-
- namespace ConstructorDemo
- {
- class Student
- {
- int id;
- string name;
- string dept;
-
- public Student(int id, string name, string dept) {
- this.id = id;
- this.name = name;
- this.dept = dept;
- }
-
- public void showData()
- {
- Console.WriteLine("Id: " + id);
- Console.WriteLine("Name: "+name);
- Console.WriteLine("Department: "+dept);
-
- }
- }
- }
-
-
-
-
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
-
- namespace ConstructorDemo
- {
- class Program
- {
- static void Main(string[] args)
- {
- Student st = new Student(101,"Sujan Hasan","CSE");
- st.showData();
-
- Student st1 = new Student(102,"Shakil Sorker","CSE");
- st1.showData();
-
- Student st2 = new Student(103, "Shimul Hossain", "CSE");
- st2.showData();
-
- Console.ReadKey();
- }
- }
- }
I am Md Abdullah Al Hasan. I have completed my graduation in Computer Science and Engineering from Jashore University of Science and Technology.
0 Comments:
Post a Comment