(a)
// Java public class Student { private String name; private int age; public String getName(){ return name; } public int getAge(){ return age; } }(b)
// C# public class Student { private string name; private int age; public string Name { get { return name; } } public int Age { get{ return age; } } }
Example 1: (a) Java class; (b) C# class.