John Losty

Ranch Hand
+ Follow
since Oct 09, 2015
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
22
Given in last 30 days
5
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by John Losty

I cannot edit the declaration in the first post.
1 week ago
I will add another 2 lines of code:



But instead of compilation error it probably does this:



Am I correct?
1 week ago
I am not sure how to visualize Multidimensional arrays in Java.

For example:



Does that mean that you have 5 references that can hold array of 2 strings ?

1 week ago

No, an uncaught exception terminates the thread it was thrown in, but doesn't terminate other threads.


I thought JVM terminates threads
1 month ago
I am running this:



So that means that even thought exception terminated 1 thread(or did it?) it didnt terminate the JVM. So therefore it cannot be the mechanism to exit the program when something unexpected happens.?

But what is than the mechanism that the JVM uses to exit the program? System.exit() ?
1 month ago
But based on the exception(handled or not) the JVM will terminate or not?  
1 month ago
While working on Mock Exams I stumbled upon this question:


My question is why the nr. 5 is not correct? Can you explain a bit more why nr. 5 is not correct?
1 month ago
@Liutauras Vilda
I am just trying to pass the Z0-808 exam. Your post has been the most applicable for me and will stick to your suggestions.

When I stumble upon some other more difficult examples I will just ask then.

I am still not sure how difficult expressions will we have to evaluate for the exam.
1 month ago
I don't understand what he has done.
He didn't said what was applied and how, he just added this line:

The compiler uses precedence and associativity to create the following expression tree: (((a * ((a++) - (--b))) * a) * b)



Than added this:

Then at runtime, order of evaluation is always left to right: ...



also this isn't clear to me as at some point he stopped evaluating from left to right and first evaluated inside brackets.
1 month ago

in this case (after respecting parens, precedence, and assoc), requires that the left operand be evaluated before the right operand.

How do you apply it?

A post higher Stephen wrote

T o evaluate an expression, the only important thing is order of evaluation. Precedence and associativity don't have anything to do with expression evaluation.

1 month ago
After this


you could go on like that as well?
1 month ago
Java Operators and Precedence, Evaluation Order ...

How can I correctly evaluate the following expression?



What should I use first from bellow to correctly evaluate line 7:
Precedence,
Associativity,
Evaluation Order
1 month ago
I could see more clearly once that method was renamed.
I think compiler expands Lambda expression into a class in the program bellow.

1 month ago
I don't understand completely the program bellow.
In order to understand lambda expressions I am trying to expand it to a class and then pass the instance of the class to the run method in main().
In the comments you can see how that class should look like.
My question is how does the class that is expanded from Lambda expression looks like?



What is confusing to me is that the interface's method has no paramaters. And in the expaned class we are suppose to implement the interface's method.
1 month ago