This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.

jon ninpoja

Ranch Hand
+ Follow
since Jul 25, 2016
Cows and Likes
Cows
Total received
3
In last 30 days
0
Total given
0
Likes
Total received
5
Received in last 30 days
0
Total given
4
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by jon ninpoja

really trying to get to grips with arrays

this code



why does changing this

for (i = 0;i < 10; i = i+1) to this  for (i = 0;i < 10; i = i++)  cause an infinite loop...isnt it the same thing?
2 months ago


hi guys

not understanding the logic in this line

table[t][i] = (t * 4) + i + 1;

finding it pretty confusing can somebody just break down whats going on in the two loops please
2 months ago
im sorry i still dont understand this

soccerteam is extended from sports team,sportsteam has 7 players set in the method
the soccerteam printplayers method is set to 11

surely it should print 7 as its inheriting from sportsteam and then using its own "11 players" value when the method is overridden?

if i instantiate from sportsteam it says 7

if i instantiate from soccerteam it says 11

if i instantiate from sportsteam it says 7 and even if i remove @overide it still says 7

i would have thought it would use the soccerteam method which is 11

sorry guys...what have i got wrong here?
2 months ago
but i thought that was the whole point

inherit from a superclass then override methods?
2 months ago
it prints 7 from the parent class not 11 from the soccer class

thanks for reading

ps"Just tell me how stupid im being and give me a clue,you dont have to solve it"
2 months ago
hi guys

why is my override method not working?






2 months ago


hi guys

i dont get what the for loop i is doing to the array
is it just putting numbers 1 to 10 into each index?

thanks
2 months ago
hello again

how used/important is breaking into labelled code blocks
i see how this works but havent done any code examples
how often is this used?
the book im reading gives examples but i cant see the practical application

any info regarding this would be greatly appreciated
3 months ago
sorry guys just cant work out how this sums up to 15
just need some explanation please

      
3 months ago
i know what if does

and i know that else is a default capture all

but what is the difference between using
if
if
if

or

if
else if
else if
else if

else

will code behave differently? would you typically use
if
else if
else if

or does it depend on what you want the result to be?
3 months ago
can you cast two variables at once?




i can get an expression working on this line
      

but what if you want to cast multiple values at once? would you just do them separately? am i splitting hairs here lol
3 months ago
yes campbell i see what you done there thanks...that makes sense
i just couldnt place using a method to dynamically initialize a variable
3 months ago
hi guys,

talking about dynamic initialization  

"The key point here is that the initialization expression can use any element valid at the time of the initialization,
including calls to methods, other variables, or literals."

i been trying to call a method but it doesnt seem to work



i know this is totally wrong,and it doesnt work and i honestly didnt expect it to work, just trying to understand the text in the book.
what would be an example of calling a method through dynamic initialization of variables?
4 months ago
Daniel "If you want to be able to acces the getMethod without initializing the class, you should declare the method static, not the variable, but in this case I wouldn't."

so whats the alternative?
6 months ago