prajkta patil

Ranch Hand
+ Follow
since Nov 13, 2004
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 prajkta patil

hi phli,
can u pls tell me the name of book & author?
thanks.
can somebody tell me how to deploy jsp on wsad?
thanku.
15 years ago
thanks to all.
nothing decided what to do next?
now i will prepare something which will help me in finding job.
give me some suggestion what to do next?
scjd or scwcd?
thanks.
prajakta..
15 years ago
sorry barry,
i know i don't have to post this here,but i want to say thanks to u & all javaranch friends who helped me to solve my problems.yesterday i passed scjp with 93%.
even u know ur goal but it is must to find the appropriate path to reach ur goal.bcause of java ranch i got the correct way..
i receives many links from java ranch.
i used following:
1]k&b book
2]dan's studyguides,dan's website is the best site .it helped me a lot.
i am very thankful to dan. ur scjp study is incomplete without dan.
3]levtek.com for links of mock exam & some more sites which gives same links.
4]marcus green's mock exams.nice exams..
i think scjp exam is easier than we think.
so don't worry.
thanks to all.
prajakta.
15 years ago
how many Strig objects get created from following code:
String s1= new String("hi");
String s2="hi";
i thik two.for String s1 two objects,one get lost in Strig pool & another is referred by s1.then s2 refers to the same string which get lost in string pool.
is it correct?
thanks in advance..
hi simon,
very nice explanation u have given.
thanks a lot.
prajakta
given two collection objects referenced by col1 & col2,which of these stmts r true?
a.the operation col1.retainAll(col2)will not modify the col1 object.
b. the operation col1.removeAll(col2)will not modify the col2 object.
c.the operation col1.addAll(col2)will return new object.
d.the operation col1.containsAll(col2) will not modify the col1 object.

if somebody knows about these methods pls tell me about that or send the link.
thanks.........
<html>
class Counter {
int v = 0;
synchronized void inc() { v++; }
synchronized void dec() { v--; }
}
public class Q7ed5 {
Counter i;
Counter j;
Counter k;
public synchronized void a() {
i.inc();
System.out.println("a");
i.dec();
}
public synchronized void b() {
i.inc(); j.inc(); k.inc();
System.out.println("b");
i.dec(); j.dec(); k.dec();
}
public void c() {
k.inc();
System.out.println("c");
k.dec();
}
}
</html>
ans:i.v is guaranteed always to be 0 or 1.
j.v is guaranteed always to be 0 or 1.

i just want to know,
suppose there is one object,it has three threads then is it possible that one thread is acceesing method a(),second thread acessing b(),& third thread accssing c()method simultaneously?
thanks rathi ji & Pete Knecht ,
i have tried.correct answer is A B C.
thanks a lot...
oh no,
after reading rathiji's post i got confused then i searched about this in the book.in book of k&b ,it is written
"The default constructor has the same access modifier as the class."
means what i have written earlier is wrong? i was thinking "By default,the constructor has the same access modifier as the class."
but according to book i guess it is not about "by default",it is about "the default constructor".& rathi ji also says same.
i think we need to run the prgs then only we can get the correct answer.
same rules r applied for valuOf method only difference is that value of method takes String or wrapper class objects not primitives.
hi amit,
i have some notes.i think it will definitely help u.
1]The Float constructor is overloaded: one version accepts a primitive of type float; one accepts a primitive of type double; one accepts a String representation of a floating-point literal.
2]in constructors of wrapper classes ,arguments of type String can not contain an integer type suffix, L or l. A floating-point suffix, F, f, D or d, is acceptable.
suppose,
Which of the instance creation expressions produce a run-time

error?

a. new Float('A')
b. new Float("A")
c. new Float(1L)
d. new Float("1L")
e. new Float(0x10)
f. new Float("0x10")
g. new Float("010")

ans:b,d,f
explanation:
i]The Float constructor is overloaded: one version accepts a primitive of type float; one accepts a primitive of type double; one accepts a String representation of a floating-point literal
ii]The String literals "NaN" and "Infinity" are accepted by the Float constructor. A sign (+ or -) is optional.
iii]The primitive char literal 'A' is converted to a float, and is accepted by the constructor that declares a parameter of type float.
iv]The API specification states that any other String must represent a floating-point value;
v]The leading 0 of an octal value is ignored, and the String is
parsed as a decimal value. A String representation of a hexadecimal
value is not acceptable.
vi]The String "A" does not represent a floating-point literal
value; therefore, a NumberFormatException is thrown.
vii]Arguments of type String can not contain an integer type suffix, L or l. A floating-point suffix, F, f, D or d, is acceptable, but the suffix has no impact on the result.
i think this much is sufficient to clear ur first doubt.
now i am thinking about second.
hi tony,
i have not written default constructor in my explanation .i have written
"By default(if u didn't specify any acess modifier for cons), the constructor will have same access modifier as the class."
hi guys i am with Parameswaran Thangavel bcause what he have written is 100% true.by default constructor have the same access modifier as that of its class.read the book carefully.