Advertisement
umasoodch

access modifiers

Mar 30th, 2015
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using mynamespace;
  10.  
  11. namespace WindowsFormsApplication1
  12. {
  13. public partial class Form1 : Form
  14. {
  15. public Form1()
  16. {
  17. InitializeComponent();
  18. }
  19.  
  20. private void button1_Click(object sender, EventArgs e)
  21. {
  22.  
  23. Class1 a = new Class1();
  24. int d =a.add(9, 5);
  25.  
  26. MessageBox.Show(d.ToString());
  27.  
  28.  
  29.  
  30. }
  31.  
  32. }
  33. }
  34. using System;
  35. using System.Collections.Generic;
  36. using System.Linq;
  37. using System.Text;
  38.  
  39. namespace mynamespace
  40. {
  41. class Class1
  42. {
  43. int a;
  44. int b;
  45. int c;
  46.  
  47. public Class1()
  48. {
  49.  
  50. }
  51. public Class1(int a1, int b1, int c1)
  52. {
  53. a = a1;
  54. b = b1;
  55. c = c1;
  56. }
  57. public int add(int a , int b)
  58. {
  59. int c=a+b;
  60. return c;
  61. }
  62. }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement