# Dmitryi Neverov

Greenhorn
since Nov 28, 2005
For More
Cows and Likes
Cows
0
In last 30 days
0
Total given
0
Likes
0
0
Total given
0
Given in last 30 days
0
Scavenger Hunt
Ranch Hand Scavenger Hunt
Greenhorn Scavenger Hunt

## Recent posts by Dmitryi Neverov

Hi! I have problem with inserting Date parameter in iBatis statement:

How can I insert in the (1) posision Date parameter? Then I try to:

#strDate# is string representation of the Date, I got error.

Then I try to:

I also get error.
Can anyone say there is my error?
Thanx.
18 years ago
I used KM book (read it 2 times) any all mocks that I can find. Thanx to you all guys, you are THE BEST!
18 years ago
18 years ago
Explain please the mechanisme of why this

18 years ago

Originally posted by Prash Gali:
Hello uzma,
Since the left most expression is evaluated first, a becomes true. Hence other assignments dont take place which would result in
a = true, b = false, c = false

ranchers correct me if i am wrong.

But why the left most expression is evaluated first, if it has lower precedence than && ?
18 years ago
Thanx.
Yes, I'm using 1.5 jdk, but I'm preparing for 310-035, and didn't know about this behavior of 1.5 jdk.
18 years ago

compiles and works fine (prints "It's work!").
[ January 17, 2006: Message edited by: Dmitryi Neverov ]
18 years ago
I think, answer on first question is C, and on second - B
18 years ago
I try:

output is:
111111111111111111111111111111111111111111111111111111111111111 //63 of 1
1111111111111111111111111111111 //31 of 1
11111111111111111111111111111111 //32 of 1

It seems that Double.POSITIVE_INFINITY first converted to int and then to byte.
[ January 13, 2006: Message edited by: Dmitryi Neverov ]
18 years ago
Thanx
18 years ago

, but

?
[ January 12, 2006: Message edited by: Dmitryi Neverov ]
18 years ago

Originally posted by Ram Roop:
The code provided here should not give any compilation errors. It would compile and run just fine. The output would be:

2
3
1

The order of execution would be:

1. initilization block execution.
2. member variable assignment.
3. constructor call.

[ January 12, 2006: Message edited by: Ram Roop ]

Agree, as it doesn't violate declare-before-read rule.
18 years ago

Originally posted by Deepthi Rallabandi:
Hi,

In java always evaluation will be from left to right.

suppose take this expression

2 + 3 * 4 - 1 * 7

here you can think of the operands in expression will be grouped as follows

step 1: 2 + (3 * 4) - (1 * 7) according to precedence rules
step 2: ((2 + (3 * 4)) - (1 * 7)) accrding to associative rules

step 3: for any operator to be applied both operands must be first evaluated.
so as evaluation is from left to write first 2 + (3 * 4) needs to be evaluated.
2+(3*4)=> 2+12=14 then
14 - (1*7)=> 14 - 7 = 7

so final result is 7.

so in your code the grouping will be as follows
(a = true) || (b = true) && (c = true)
=> ((a=true) || ( (b=true) && (c=true) ))
as evaluation will be from left to write
(a=true) is evaluated first which results in true and "a" is assigned value true .
as || is short hand operator if left operand is true, right operand is not evaluated.

so output will be true, false , false as default values for b and c are false.

Please explain why in KM book there is phrase

The evaluation order also respects any parentheses, and the precedence and associativity rules of operators.

Doesn't this means that operands of && operator must evaluated before operands of || , as && have higher precedence?
[ January 12, 2006: Message edited by: Dmitryi Neverov ]
18 years ago
If any checked exception is thrown during execution of an initializer expression, it must be caught and handled by code called from the initializer expression. This restriction does not apply to instance initializer expressions in anonymous classes. (KM book)

But why:

then compile, get error:
18 years ago
Khalid's book said that changes in the map are reflected in the views, and vice versa.

is:

11
12
13
14//there is no 15
1
2
3
4
5//they are still 1,2,3,4,5 not the 11,12,13,14,15

Underlying map is changed, but the view is not.
And view is changed, but map is not.

Why?
18 years ago