improvements initializing arrays
This commit is contained in:
parent
8c527a98de
commit
2f0de3f778
@ -9,7 +9,7 @@ public class Aufgabe04 {
|
|||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
final int laufzeit = 4;
|
final int laufzeit = 4;
|
||||||
final double startwert = 100.0;
|
final double startwert = 100.0;
|
||||||
final double[] zinssaetze = { 2.0, 2.5, 3.0 };
|
final double[] zinssaetze = new double[] { 2.0, 2.5, 3.0 };
|
||||||
double entwicklung[][] = new double[laufzeit][zinssaetze.length];
|
double entwicklung[][] = new double[laufzeit][zinssaetze.length];
|
||||||
|
|
||||||
for (int i = 0; i < laufzeit; i++) {
|
for (int i = 0; i < laufzeit; i++) {
|
||||||
|
@ -11,7 +11,7 @@ public class Aufgabe05 {
|
|||||||
final int DIR_RIGHT = 1;
|
final int DIR_RIGHT = 1;
|
||||||
final int NUM_FROGS = 100;
|
final int NUM_FROGS = 100;
|
||||||
int[] numbersrow = new int[1000];
|
int[] numbersrow = new int[1000];
|
||||||
int[] bucket = { 0, 0 };
|
int[] bucket = new int[] { 0, 0 };
|
||||||
|
|
||||||
int position = 1;
|
int position = 1;
|
||||||
int position_max = position;
|
int position_max = position;
|
||||||
|
@ -27,7 +27,7 @@ public class Aufgabe01 {
|
|||||||
* @return The fibonacci number.
|
* @return The fibonacci number.
|
||||||
*/
|
*/
|
||||||
private static int iterativeFibonacci(int nth) {
|
private static int iterativeFibonacci(int nth) {
|
||||||
int[] fib = { 1, 1 };
|
int[] fib = new int[] { 1, 1 };
|
||||||
|
|
||||||
for (int i = 0; i <= nth; i++) {
|
for (int i = 0; i <= nth; i++) {
|
||||||
if (i < fib.length)
|
if (i < fib.length)
|
||||||
|
Loading…
Reference in New Issue
Block a user