daily pastebin goal
82%
SHARE
TWEET

Untitled

a guest Oct 12th, 2017 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. public class Person {
  4.  
  5.   private String firstName;
  6.  
  7.   private String lastName;
  8.  
  9.   public String FirstName{get;set;}
  10.  
  11.   public String LastName { get; set; }
  12.  
  13.   public Person(String fName, String lName) {
  14.     this.firstName = fName;
  15.     this.lastName = lastName;
  16.   }
  17.  
  18.   public void display() {
  19.     Console.WriteLine("Firstname: " + Firstname + ", Lastname: " + Lastname);
  20.   }
  21. }
  22.  
  23.  
  24. public class Solvation {
  25.  
  26.   public static void Main(String[] args) {
  27.     Person[10] persons = new Person[10];
  28.    
  29.     for (int i=0; i< persons.Length; i++){
  30.       persons[i] = new Person("Name " + i, "Lastname " + i);
  31.     }
  32.    
  33.     for (int i=10; i == 0; i--){
  34.       persons[i].display();
  35.     }
  36.   }
  37.  
  38. }
RAW Paste Data
Top