forked from tarunsinghofficial/HacktoberFest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request tarunsinghofficial#1825 from Kalashkalwani/main
Code of Association in Java
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
class bank | ||
{ | ||
public String name; | ||
bank(String name) | ||
{ | ||
this.name=name; | ||
} | ||
public String getbankname() | ||
{ | ||
return this.name; | ||
} | ||
} | ||
|
||
class employee | ||
{ | ||
private String name; | ||
|
||
employee(String name) | ||
{ | ||
this.name=name; | ||
} | ||
|
||
public String getemployeename() | ||
{ | ||
return this.name; | ||
} | ||
} | ||
|
||
class Association | ||
{ | ||
public static void main(String args[]) | ||
{ | ||
bank Bank=new bank("AXIS BANK"); | ||
employee emp=new employee("NEHA"); | ||
|
||
System.out.println(emp.getemployeename()+" is employee of "+Bank.getbankname()); | ||
} | ||
} |