SHARE
TWEET

Untitled

a guest Oct 18th, 2019 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // C# program to print Hello World!
  2. using System;
  3.  
  4. // namespace declaration
  5. namespace HelloWorldApp {
  6.  
  7.     //[access modifier] - [class] - [identifier]
  8.     static class Judge
  9.     {
  10.         private String name;
  11.         private String surname;
  12.         public int height;
  13.  
  14.         public Judge() //privzeti konstruktor
  15.         {
  16.             name = "none";
  17.             surname = "none";
  18.             height = 0;
  19.         }
  20.  
  21.         public Judge(string nameInput, string surnameInput, int heightInput) //nastavitveni konstruktor
  22.         {
  23.             name = nameInput;
  24.             surname = surnameInput;
  25.             height = heightInput;
  26.         }
  27.  
  28.         private String getName()
  29.         {
  30.             return name;
  31.         }
  32.         private String getSurname()
  33.         {
  34.             return surname;
  35.         }
  36.         private void setName(string nameInput)
  37.         {
  38.             name = nameInput;
  39.         }
  40.          
  41.         private void setSurname(string surnameInput)
  42.         {
  43.             surname = surnameInput;
  44.         }
  45.  
  46.  
  47.     // Fields, properties, methods and events go here...
  48.     }
  49.      
  50.     // Class declaration
  51.     class Geeks {
  52.          
  53.         // Main Method
  54.         static void Main(string[] args) {
  55.              
  56.               Judge sodnik = new Judge();
  57.               string nameOfJudge = sodnik.getName();
  58.               int heightOfJudge = sodnik.height;
  59.  
  60.             Console.ReadKey();
  61.         }
  62.     }
  63. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top