Download
slide1 n.
Skip this Video
Loading SlideShow in 5 Seconds..
public class A{ private int a; private int b; public A(int c){ a = c; b = c*c*c; } PowerPoint Presentation
Download Presentation
public class A{ private int a; private int b; public A(int c){ a = c; b = c*c*c; }

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

148 Vues Download Presentation
Télécharger la présentation

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - 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