pinky yadav

Ranch Hand
+ Follow
since Jun 17, 2002
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by pinky yadav

if you want whole string as one entry in array then do

if you want each word as seperate word in array then
19 years ago
its not very clear what you want to do actually.
but if you want to convert string to array of string like this

then you can use StringTokenizer which will extract the works for you from the string and then you can put it in array of string.
[ August 11, 2004: Message edited by: pinky yadav ]
19 years ago
i dont think there is any one step process to do it.
using following code you can get Integer array

then if required you can use it as

hope it helps
[ July 22, 2004: Message edited by: pinky yadav ]
19 years ago
there are many ways to pass a value from jsp to servlet.
1) put value in session and retrieve it in servlet.
on jsp page session.setAttribute("v1",v1). this puts the v1 in session which you can retrieve in servlet by req.getSession().getAttribute("v1")

2) pass the value in url string for get method.
you need to do req.getParameter("v1") in servlet.

hope it helps
20 years ago
In java there is no pass by reference but only pass by value. so what happens is when u pass a argument to method it makes a copy of that which is then passed on.
(Now confusing bit)
when u pass a object you actually pass a reference which is pointing to that object. so similar to primitive thing java makes a copy of that reference and sends across to method. now actually speaking its a new copy of ref but since this ref is also pointing to the same object u get the object ref there. which u can think of as pass by ref but IT'S NOT.
So if u assign a new object to that ref u lose the original object.
i hope it helps clear ur doubt.
20 years ago
you are right finally is a block of code which like any block of code can throw exception and rest of the statements in the block are not executed
20 years ago
regarding the first assumption its correct.
if you take 2D array if any object instead of int then casting to Object[][] is allowed at line 4.

on first iteration with i=0
ia = obj[0] // {1,2}
on next iteration with i=1
ia = obj[1] // {0,1,2}
on next iteration with i=2
ia = obj[2] // {-1,0,2}
so its a 1D array only and we can surly print elements of it with single index
its printing z because variable is inherited to the subclass.
interesting comment

Nothing can be returned from a void, but you can return nothing.

yes all the classes extend from object. and there is no difference if you extend explicitly.
These are the Objectives for both exams:
or rather check out one of the previous trails here. it has quite descriptive matter
[ May 19, 2003: Message edited by: pinky yadav ]
one more point the static valueOf(boolean) and valueOf(String) method return reference to the static Boolean object in the class Boolean.
thus the following code gives the output as:
method binding for static methods happens at compile time as they are not overidden. (they are inherited)
therefore both times method from foo is getting called as we are calling the method using reference of type foo.
Hope this is helpful.
the static methods are inherited. But they are not overriden.
Instead they are hidden.