Martin Gerard

Greenhorn
+ Follow
since Apr 04, 2021
Studying Java
UK
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
11
Given in last 30 days
4
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Martin Gerard

aah a syntax error. oops
1 week ago
Whats the difference between = and =>
Can anybody help please?
e.g
int aNum = 3;



Don't they do the same thing?
Its just the behaviour of the operators that is puzzling me.
1 week ago

Why when using an editor do I get the error:
Error: line 4 - cannot find symbol - method charAt(int)
I am trying to extract the integer characters from the String to then Parse them into Integers.
I am just using println() to check character extraction.
1 week ago
Given the statement:



Is the code between the outer parenthesis an actual argument?
1 week ago
Sorry. Are you saying that for loops can always be written as while loops?
1 week ago
For loops cannot always be written as while loops?
Is this true? I realise that for loops are used when the number of iterations required is known and the while loop is used when the number of iterations are not known. Also with simple for loops I think a while loop could suffice. I am guessing that more complex for loops would not be able to be converted to a while loop. Can anybody please explain is newbie terms why the question is or is not true?
1 week ago
my code has the following structure:

1 month ago
Hello folks!

I am struggling with some code. I have a variable that is required to change every time a method is invoked. I need the sequence to output the values 0 then 1 then 2 then 3 then 2.
I have managed to write an if statement that changes the integer from 0 to 1 and then I have used else if statements to change the integer to 2 then 3 then back to 2. Can anybody help me to change the integer to 0 upon the first loop? The integer is initialised to 0.


1 month ago