1 / 1

public class A{ private int a; private int b; public A(int c){ a = c; b = c*c*c; }

Test 5. Perekonnanimi. Eesnimi. Objetorienteeritud programmeerimine 2008/2009 kevadsemester E 12-14 ruum L203. public class A{ private int a; private int b; public A(int c){ a = c; b = c*c*c; } public String toString(){return a + " , " + b;} }.

marah-casey
Download Presentation

public class A{ private int a; private int b; public A(int c){ a = c; b = c*c*c; }

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Test 5 Perekonnanimi Eesnimi • Objetorienteeritud programmeerimine • 2008/2009 kevadsemester • E 12-14 ruum L203 public class A{ private int a; private int b; public A(int c){ a = c; b = c*c*c; } public String toString(){return a + ", " + b;} } public class B extends A{ private int c; public B(int a, int c){ super(a); this.c = c; } public String toString(){return super.toString() + "; " + c;} } public class C{ public static void main(String[] args){ B b = new B(3, 13); System.out.println(b); } } Väljastatakse konsoolile: 3, 27; 13 Pöördele: arvamused, ettepanekud, soovid

More Related