Home > Java > javaTutorial > Java implements simple factory pattern

Java implements simple factory pattern

高洛峰
Release: 2016-12-15 14:20:09
Original
1563 people have browsed it

A farm company is responsible for cultivating various fruits. The fruits in this system include grapes, strawberries and apples. The class diagram is shown in the figure. Please write the program according to the following requirements:

1. Apply the simple factory method mode, and complete the description of its growth status according to the name of the fruit entered on the keyboard in the main program.

2 For related articles, please pay attention to the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template