About Question com.enthuware.ets.scjp.v6.2.523 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
jwilde3
Posts: 1
Joined: Sun Nov 09, 2014 5:52 pm
Contact:

About Question com.enthuware.ets.scjp.v6.2.523 :

Post by jwilde3 »

:lol: The following program will always terminate.

true or false.

Yes, I saw the possibility for an endless loop... But my logic consisted of... even if it's an endless loop, It will eventually Stack Overflow. So Yes(true), It will always terminate (eventually)....

Correct answer :

false : It is very possible It could get stuck in an endless loop.



Now that I think about it.... if it is just variables that are being incremented and only taking up x amount of space on 2 threads.... will a stack overflow ever happen? because there is enough memory to store 2 threads with a couple int's.. (I am assuming no, please correct me if im wrong)

now if each thread in an endless loop created an object or a new thread , thus taking memory and making a stack overflow occur, would the people that write this test consider that termination?

3rd test in 6 hours... my Java Mind is :shock:

admin
Site Admin
Posts: 10043
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question com.enthuware.ets.scjp.v6.2.523 :

Post by admin »

Looping doesnt cause Stack Overflow. Calling method inside a method repeatedly like inrecursion does.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests