
Based on the following algorithm, write a Java Program
Start defining the MyClass class. Declare the class?s myField data field. Initialize the data field. Start defining the SetField() method. Set the data field to the value passed to SetField(). Start defining the GetField() method. Return the value of the myField data field.

class MyClass{
private int myField;
public MyClass(int value){
myField = value;
}
public void SetField(int value){
myField = value;
}
public int GetField(){
return myField;
}
public static void main(String []args){
MyClass cl=new MyClass(10);
int i=cl.GetField();
System.out.println(i);
}
}