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



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
3 days 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
2 weeks ago
sorry guys just cant work out how this sums up to 15
just need some explanation please

      
2 weeks 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 weeks 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
1 month 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
1 month 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?
1 month 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?
3 months ago
thanks fred yes that makes sense
thanks all,will try a few things tomorrow
3 months ago
Hey Vishal,

Dont be afraid,you are obviously good at your job and enjoy where you are...dont let one bad experience bring you down...i think you missing the golden opportunity..i would kill to be where you are,im only starting a software degree at the end of this year.
chin up,if you want to do it i dont think anything can stop you...but you have to ask yourself the question...and be honest with yourself.
3 months ago
i added this method:



to TeamManager

and this instance variable
ArrayList<String> teamList = new ArrayList<String>();

but in this code:



TeamManager.getTeamList method is not available...how can i have it use methods of a class without instantiating the class? surely the arraylist has to be static...or have i got something wrong?

3 months ago
ok so here is what i have so far:









ignore the commented out code that was my object creation from user input,it works but i need to assemble this program better now.

in the TeamManager class i have a static int variable that will keep track of how many teams have been created

in the TeamManager class i will have the various methods to add a team,minus a team etc etc

ok so a few questions:

where would the best place be to put the arraylist?

shouldnt it be a static arraylist with static methods accessing the arraylist as it will be created and will always keep it in memory and make it available from everywhere in the program?
as what happens when somebody lists a team,and havent created a team yet...the arraylist needs to be initialised first but if i do that in a local scope it wont be able to be used later in the program

thanks for reading looking forward to feedback...


3 months ago
should my array list that will contain all my teams be static? would that make sense?
3 months ago
is factory method the same as factory design pattern...are factory methods just part of the factory design pattern? just watching a video on factory design patterns?
3 months ago