Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package springpractice;
- public class Constructor {
- public static class sc{
- String name,gender;
- long phone;
- void setInfo(String n,String g,int p) {
- name=n;
- gender=g;
- phone=p;
- }
- void display() {
- System.out.println("Name: "+name);
- System.out.println("gender: "+gender);
- System.out.println("Phone Number: "+phone);
- }
- }
- public static void main(String[] args) {
- sc s=new sc();
- s.name="Dr.Md.Kamal Pasha";
- s.gender="Male";
- s.phone=(long)17353793;
- s.display();
- }
- }
Add Comment
Please, Sign In to add comment