improvements initializing arrays

This commit is contained in:
Sebastian Brosch 2024-05-16 10:50:07 +02:00
parent 8c527a98de
commit 2f0de3f778
3 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@ public class Aufgabe04 {
public static void main(String[] args) {
final int laufzeit = 4;
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];
for (int i = 0; i < laufzeit; i++) {

View File

@ -11,7 +11,7 @@ public class Aufgabe05 {
final int DIR_RIGHT = 1;
final int NUM_FROGS = 100;
int[] numbersrow = new int[1000];
int[] bucket = { 0, 0 };
int[] bucket = new int[] { 0, 0 };
int position = 1;
int position_max = position;

View File

@ -27,7 +27,7 @@ public class Aufgabe01 {
* @return The fibonacci number.
*/
private static int iterativeFibonacci(int nth) {
int[] fib = { 1, 1 };
int[] fib = new int[] { 1, 1 };
for (int i = 0; i <= nth; i++) {
if (i < fib.length)