This is a collection of examples illustrating how one could program some simple arithmetic functions in Java, ranging from ugly to bad to good. The order from ugly to perfect is as follows:
- ugly
- terrible
- bad
- good
- better
- great
import java.awt.Color; | |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
import java.nio.file.StandardOpenOption; | |
import de.informatics4kids.Picture; | |
public class Histogramm { |
/* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
* GNU General Public License for more details. |