Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package springpractice;
- import springpractice.Constructor.sc;
- public class Static {
- public class student{
- String name;
- int id;
- static String universityName="DIU";
- public student(String n,int i) {
- name=n;
- id=i;
- }
- void display() {
- System.out.println("Name: "+name);
- System.out.println("ID: "+id);
- System.out.println("University Name: "+universityName);
- }
- }
- public static void main(String[] args) {
- student s1=new student("Anisul",101);
- student s2=new student("Mohaiminul",102);
- s1.display();
- s2.display();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement