Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package springpractice;
- import springpractice.Constructor.*;
- public class Overloading {
- 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();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement