Seshadri M

Seshadri M

  • NA
  • 69
  • 16.6k

Pass value from one object to another using objectclass

Sep 19 2017 1:55 AM

I have below try sample code using objectclass.

  1. class general  
  2. {  
  3. int id = 1;  
  4. string name = "Employee";  
  5.   
  6. }  
  7. class general2  
  8. {  
  9. }   
  10. class Program  
  11. {  
  12. static void Main(string[] args)  
  13. {  
  14. general g= new general();  
  15. general2 h = new general2();  
  16. //g.Employee= h;  //errror   
  17.  g.Equals(h);   
  18. Console.WriteLine(g.ToString());  
  19. Console.ReadLine();  
  20. }  
  21. }  
OUTPUT
//namescape
 

Answers (1)