Lec : 21 | java
LEC:21
package oops;
import java.util.Scanner;
class Student {
// data members
private
int a,b;
// member function
public
void set(int a1,int b1)
{
a=a1;b=b1;
}
void get()
{
System.out.println("The value of a : "+a+" and b : "+ b);
}
}
public class OOPS {
public static void main(String[] args) {
Student O1=new Student();
O1.set(4, 7);
O1.get();
}
}
Comments
Post a Comment