Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search Coderanch
Advance search
Google search
Register / Login
R Pats
Greenhorn
+ Follow
2
Posts
2
Threads
0
Cows
since Dec 21, 2014
Merit badge:
grant badges
For More
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
Ranch Hand Scavenger Hunt
Number Posts (2/100)
Number Threads Started (2/100)
Number Cows Received (0/5)
Number Likes Received (0/10)
Number Likes Granted (0/20)
Set bumper stickers in profile (0/3)
Report a post to the moderators (0/1)
Edit a wiki page (0/1)
Create a post with an image (0/2)
Greenhorn Scavenger Hunt
First Post
Number Posts (2/10)
Number Threads Started (2/10)
Number Likes Received (0/3)
Number Likes Granted (0/3)
Set bumper stickers in profile (0/1)
Set signature in profile
Search for a post/thread (0/3)
Set a watch on a thread
Save thread as a bookmark
Create a post with an image (0/1)
Recent posts by R Pats
Is a for-loop broken out of as soon as the condition is not met?
For example, I am testing something w/ the following code:
int b = 8; int e = 9; for (int i = b; i < e; i++) { if (i == 8) { b = 0; e = 8; } System.out.println("Number: " + i); }
And it is only printing out:
Number: 8
I don't exactly understand why it is not starting the for loop again how that I have updated b & e?
show more
8 years ago
Beginning Java
I am trying to return an array, and it is printing out random characters?
This is my code:
public class rotate { public static void main(String[] args) { int[] arrayInput = {1, 7, 8, 6, 2}; for(int i = 0; i<arrayInput.length; i++) { System.out.print(arrayInput[i] + " "); } System.out.println(""); System.out.println(reverseArray(arrayInput, 3)); } public static int[] reverseArray(int[] array, int x) { return array; } }
It's printing out this (the second line):
show more
9 years ago
Beginning Java