Nick Zapo

Greenhorn
+ Follow
since Aug 21, 2019
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nick Zapo

is it possible to replicate only the backend in vertical approach (with micro frontend) or is it more like a block (frontend/backend tightly coupled)?
There is no particular reason that I didnt use an array initialiser.
In the for loop the updateStatement is executed after the loop execution (body). And if I don't mess around with the i variable, from the initialization block, inside the body - everything will be fine. In while and do while, in this example, I increase the value of variables inside the body. So I need to pay attention at what point I increment the variables i and j. Another thing is a scope of i and j, I initialized both with the value 0 but after execution of the loops the value is not 0 anymore.If I move the ++ to the line 47 I will increase j after the condition check and provoke out of bound exception.
Yes I read about the Object.clone(), it creates and returns a shalllow copy of the object. So in this case the copy of the array middleNames. But I'm stil not sure why I would use it in the getMiddleNames method. Why not just return this.middleNames.
2 years ago
ok, sorry. So here is the final version

2 years ago
hi, those are my solutions how to iterate trough array.



String[] str = new String[0] is a valid array with size 0. You can get index out of bound exception if you try to set or get a value from this array ex. a[0] = "abc".
.clone() need to read/learn about this one, advantages disadvantages and how to use it properly.

Hey Tim,
yes i tried this one:

Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Syntax error on token "3", delete this token


2 years ago
Hi Campbell Ritchie, I'm new here and just started to prepare for OCA. I would like to try to answer questions, please correct me if im wrong. 1: not possible to declare the length and initialize array at the same time. 3: you will get out of bound exception - array is initialized but is empty  (no elemment on position 0). 4: iterate with  help of "foreach" or for. But why are you using .clone() in the getMiddleNames()?
2 years ago