Guest User

Untitled

a guest
Dec 13th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace StaticApp
  8. {
  9. class Student
  10.  
  11. {
  12. public string Name;
  13. public static string Prenume;
  14.  
  15.  
  16. public void printable()
  17. {
  18. Console.WriteLine("{0} {1}", Name,Prenume);
  19. }
  20.  
  21. }
  22. class Program
  23. {
  24.  
  25. static void Maine(string[] args)
  26. {
  27. Console.WriteLine("hgaethaeth");
  28. }
  29.  
  30. static void Main(string[] args)
  31. {
  32. Console.WriteLine("aerg");
  33. Student student = new Student();
  34. student.Name = "Adi";
  35. //// the static variable can not be accessed, the static variable can be accessed
  36. //student.Prenume = "G";
  37. student.printable();
  38.  
  39.  
  40. Console.ReadKey();
  41. }
  42. }
  43. }
Add Comment
Please, Sign In to add comment