Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // C# program to print Hello World!
- using System;
- // namespace declaration
- namespace HelloWorldApp {
- //[access modifier] - [class] - [identifier]
- static class Judge
- {
- private String name;
- private String surname;
- public int height;
- public Judge() //privzeti konstruktor
- {
- name = "none";
- surname = "none";
- height = 0;
- }
- public Judge(string nameInput, string surnameInput, int heightInput) //nastavitveni konstruktor
- {
- name = nameInput;
- surname = surnameInput;
- height = heightInput;
- }
- private String getName()
- {
- return name;
- }
- private String getSurname()
- {
- return surname;
- }
- private void setName(string nameInput)
- {
- name = nameInput;
- }
- private void setSurname(string surnameInput)
- {
- surname = surnameInput;
- }
- // Fields, properties, methods and events go here...
- }
- // Class declaration
- class Geeks {
- // Main Method
- static void Main(string[] args) {
- Judge sodnik = new Judge();
- string nameOfJudge = sodnik.getName();
- int heightOfJudge = sodnik.height;
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement