Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Point{
- int x,y;
- public Point(int x, int y){
- this.x=x;
- this.y=y;
- }
- public void affcord(){
- System.out.println("coordinates: ("+x+", "+y+").");
- }
- }
- public class PointNom extends Point{
- String nom;
- PointNom(int x, int y, String nom){
- super(x,y);
- this.nom= nom;
- }
- public void affcordNom(){
- System.out.println("Point "+nom+": ("+x+", "+y+").");
- }
- public static void main(String[] args) {
- PointNom zoubi = new PointNom(1,2,"chra9abaw");
- zoubi.affcordNom();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement