Joe Simpson

Greenhorn
+ Follow
since Sep 14, 2015
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
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Joe Simpson

I am working through a tutorial to learn Java and I have come across this example.

public static void main(String[] args) {




I do not understand how the [i] is being used in this example. When I look at result[i] or any other variable with [i] at the end? I thought that the [i] means that you passed that specific array into that local variable within the for loop but I do not understand how you pass the length of another array in the result[i] part of the code?
results[i] = leftVals[i] + rightVals[i];
so would that mean when it runs through the first time that it is actually saying this.
0 = 100.d + 50.d;
This is very confusing to me. Than you for the help.



5 years ago
Ok. That makes sense now! I appreciate the quick responses!
5 years ago
Ok so I am referring to my Class Assignment. I understand that now. So the mCurrentAssignment is just the name of my object now? After I initialize it within the class that I am referencing Assignment from?
5 years ago
I am currently going through a Java course and I have a question about what is currently taking place.

I have two classes that I am working with, one called Assignments, and one called Student.

After writing some basic methods within the Assignment Class my professor switched over to the Student class and proceeded to write the following code.

private double mGpa;
private Assignment mCurrentAssignment;


What is going on with the second line? Are you calling the Class Assignment and making it a variable? I am confused with how this is working?
I appreciate any help!

thanks.
5 years ago
Ok. I am completely lost when it comes to the difference between instance variable(non-static fields) and class variables(static fields)? I have looked and researched for the past couple of hours and for some reason I can not figure out what instance really even means in this context? I am just completely lost when it comes to this. Can someone I guess dumb it down for me? Thanks.
5 years ago
Hi,

I am new to the java world and have just picked up the Head First Java book and need some help. I have Mac OSX operating system but I am having a lot of trouble getting everything set up using the command line to even get started with the book. I am not sure where to find the SDK, and if I do find it I do not really understand how to add an entry to my PATH environment? I am completely lost. Any help at all would be much appreciated. Thanks.

6 years ago