Nick David

Greenhorn
+ Follow
since Jun 17, 2017
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
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nick David

I have a little homework assignment where I am supposed to return any given number of prime elements in an array.
Here is my code:


I'm a little confused because 65 is being output as a prime number. The correct output should be 43 and 41. I know that 65 isn't prime, but rather a composite number. I've been at this for a while but I can't quite think it out without getting stuck. Any feedback would be appreciated!
6 years ago
I'm kicking myself with how simple that solution is. Thanks for the explanation.
6 years ago
Simple app would be better since I don't have a lot of experience with Android Studio.
6 years ago
Hello all. I'm getting a solid understanding of my basics in Java this summer. I had a tutor recommend a site called "practice it", and it's pretty nifty. Anyways, one problem they have has this bit of code:

My question is, why does the MAX change inside the for loop? I thought that once a data type was declared "final" that it was unalterable. Any help would be awesome.
Thanks.
6 years ago
Right now I am interested in Android development. That said, I'm open to suggestions in other fields as well
6 years ago
Hello all. I have about a year of Java under my belt and I just finished my first Java class quarter. I have the summer off and I am brainstorming some projects to develop. Any ideas and suggestions would be awesome!
6 years ago
I am assuming you wanted to print from 10 down to 2. In that case, what your loop is essentially saying is  i = 10, then i is < 1. This will never run because 10 is not less than 1. Change "i < 1;"  to "i > 1;" since i is 10, an 10 is greater than 1. And welcome to the Java world
6 years ago