Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Access Specifier

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
 namespace Unit_1
 {
     struct Books
     {
         public string title;
         public float price;
         public int page;
         public void getvalues(string t,float pr,int pg)
         {
             title =t;
             price =pr;
             page =pg;
         }
  
         public void display()
         {
             Console.WriteLine("title:{0}",title);
             Console.WriteLine("price:{0}",price);
             Console.WriteLine("page:{0}",page);
         }
     };
     class program
     {
         static void main(string[] args)
         {
             Books Book1 =new Books();
             Books Book2 =new Books();
             
             Book1.getvalues("c programming",600.50,800);
             Book2.getvalues("c# programming",1000.50,899);
             Book1.display();
             Book2.display();
             Console.ReadKey();
         }
     }
 }

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.