Kanika Khanna

Greenhorn
+ Follow
since Mar 11, 2012
Merit badge: grant badges
For More
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 Kanika Khanna

You mean to say there are two literals "Fred" and "47". Rest 3 are objects.bt how can we make sure that both string are present in pool???. If they are not in pool,then new objects would be created for both.right??? wrote:

Answer should be either 5 or 6.
6 in case toString() creates a new string Object.But it was given 3 in some test papers.
But ans given is3??
What about toString()??? It doesn't create any new string object???
have checked with oracle site.I didnt find serialization in Objectives???
What should be ans ???

11. public String makinStrings() {
12. String s = “Fred”;
13. s = s + “47”;
14. s = s.substring(2, 5);
15. s = s.toUpperCase();
16. return s.toString();
17. }
How many String objects will be created when this method is invoked?
A. 1
B. 2
C. 3
D. 4
E. 5
F. 6
In addition to Swapnil's question,I want to know why
javac -classpath MyJar.jar GetJar.java
java -classpath MyJar.jar GetJar.java
is incorrect?

Only one thing is specified in book is current directory i.e. should be super directory of root dirctry i.e myApp.Difference for javac and java is not specified