Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. package Customre;
  2.  
  3. class User {
  4.  
  5. protected String userid;
  6. protected String passwrd;
  7.  
  8. public User(String userid, String passwrd) {
  9. this.userid=userid;
  10. this.passwrd=passwrd;
  11.  
  12. }
  13.  
  14. public void display() {
  15. System.out.println("User id = "+userid+"\n Passward = "+passwrd);
  16.  
  17. }
  18.  
  19. }
  20.  
  21. public class Customre {
  22. Item i;
  23.  
  24. private String name;
  25. private String email;
  26.  
  27. public Customre(String name, String email) {
  28.  
  29. this.name=name;
  30. this.email=email;
  31.  
  32. }
  33.  
  34. public static void main(String[] args) {
  35. Customre obj=new Customre("arafat Sunny","anisur15-2741@diu.edu.bd");
  36. User obj2= new User("Anisur","1234");
  37.  
  38. Item obj3=new Item("One Plus 6",47500.9);
  39. }
  40.  
  41. }
  42.  
  43. class Item {
  44.  
  45. Customre c;
  46. private String itemname;
  47. private double price;
  48.  
  49. public Item(String itemname, double price) {
  50. this.itemname=itemname;
  51. this.price=price;
  52.  
  53. }
  54.  
  55. public void display() {
  56. System.out.println("Phone Item name = "+itemname+"\n Price = "+price);
  57.  
  58.  
  59. }
  60.  
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement