1 / 4

C++ ADT Example The Stack

C++ ADT Example The Stack. Java ADT Example The Stack. C++ Parameterized ADT The Stack. Java Naming Encapsulation Example. package Square; public class area { public double compute(double side) { return (side*side); } }. package Circle; public class area {

jarrodp
Download Presentation

C++ ADT Example The Stack

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. C++ ADT Example The Stack

  2. Java ADT Example The Stack

  3. C++ Parameterized ADT The Stack

  4. Java Naming Encapsulation Example package Square; publicclass area { public double compute(double side) { return (side*side); } } package Circle; publicclass area { public double compute(double radius) { return (3.14*radius*radius); } } import java.lang.*; import Circle.area; publicclass Main { public Main() { } publicstaticvoid main(String[] args) { Square.area s = new Square.area(); area c = new area(); System.out.print("Circle area: "); System.out.println(c.compute(5.0)); System.out.print("Square area: "); System.out.println(s.compute(5.0)); } }

More Related