Dan Polak

Ranch Hand
+ Follow
since Nov 06, 2006
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 Dan Polak

Mirko thanks for reply...

I know all of that... but it is strange for me

If I can't write anything to the client after forwarding I should get an exception in my opinion

regards
In my opinion only you need is to synchronize these two methods. Thats all.
hi everyone

I have two servlets and two doGet methods

first:


second:


I didn't get any exception but i think i should...
Can any one explain this?

regards
consider that

String s = ",aa,aaa,aa,,,,";
out.println(s.split(",").length);//4

String s = ",aa,aaa,aa,,,,";
out.println(s.split(",",0).length);//4

String s = ",aa,aaa,aa,,,,";
out.println(s.split(",",10).length);//8
Check yourself , do not use JVM!!!

*List<Integer> v = new ArrayList();
*List<String> v1 = new ArrayList();
*
*out.print(v == v1); //line 3
*out.println(v.equals(v1));

a) prints falsefalse
b) compile time error
c) prints truetrue
d) if 'line 3' will be removed prints true
e) prints falsetrue
f) if 'line 3' will be removed prints false
Long IS A Object, but Long IS NOT A String

Originally posted by Jothi Shankar Kumar Sankararaj:
Guys, I guess we are talking on two different questions, one with the f array and the other with the s array. With the originally posted question by Pandoo, the answer is 4.



NO The answer is 3

there are created only 6 objects s, s[0],s[1],s[2],s[3], s1(empty!!!)

next
s1[0] -> s[0];
s1[1] -> s[1];


so egiligible object are:
s, s[2],s[3]
5 is not true Krzystof because we can create and start thread in that method
Maybe someone know where is definition of static method values() whitch is available for every enums instance ?

enum A {

}

A[] a = A.values();
Of course it is not possible

What will happen when I run your methot like this

List<Integer> i = backwords(new ArrayList<Object>());

???
The answers doesn't fit to question!!!
Read one more time your question

Originally posted by xitiz bhatia:
K&B have mentioned the method declaration as erronous in their errata at the link below--
https://coderanch.com/t/257589/java-programmer-SCJP/certification/SCJP-Errata-Updated

Now the method declaration becomes-
public static <E extends Number> List<E> process(List<E> nums)



now answer is B,E,F

i missed it in errata
For example

if you write your own class NewClass extends CharSequence ...
it couldn't fit to String

so

<? extends CharSequence> doesn't fit to <String>