Win a copy of Microservices Testing (Live Project) this week in the Spring forum!

shank ram

+ Follow
since Sep 05, 2005
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 shank ram

So, put things in perspective ... would it be correct to say:

Java is an open specification and not open source.

Are there ABSOLUTELY NO attributes of open source that is applicable to Java?
16 years ago
A question here ... is Java Open Source? Java is definitely not GPL, but still it is free to download,implement and develop ... so what exactly should one make out of it and what classification would it come under?
[ September 27, 2005: Message edited by: shank ram ]
16 years ago
Found this question on SCJP forum but there was no convincing answer... so I am posting the link here:
16 years ago
i think we have had this before ...this is bound to be moved shortly ... check the appropriate forum to post properly.
16 years ago
Thanks all !

"Funda" is the shortened form "Fundamental Logic"

Now, I know what is coming next ... a rap ... asking me to use language to suit an international audience . But, dont you worry "funda" will soon worm its way into to the OED ...
16 years ago
Thanks Steve!

Do the calls for println() and print() while printing out an object always default to toString() ? Where can I find the official document for this funda?

And also is it possible to observe this using "javap":
I tried
javap java.lang.System

How to infer from the output of the above two - regarding the default use of toString() method?
[ September 14, 2005: Message edited by: shank ram ]
16 years ago
Code Listing 1:

Code Listing 2:

I have two questions:
1. The code listing 1 gives the output - J A V A
What is the reasoning behind this ?

2. On changing the name of toString() to something else - the output is a quirky looking string ts@17590db - what exactly is happening here?

Thanks in advance!
16 years ago
The question you have posed analyses your grasp of fundamental array concepts.

The last element of a array 'p' of 100 integer elements is addressed as what ... p[100] or p[99] ? - This is the first point to be understood.

After you successfully cloned the array 'p' ... will the change in an element of the clone ... here 's' ... reflect on the original 'p' ? - This is the second point.

So, write the code

Hope this helps.
16 years ago
Include this method in your code and call clrscr():

private static void clrscr() {
for (int i=0; i<=60; i++) {
16 years ago
Please clarify your objective, what is it that you want to know ?
I had a similar query some time back:
Check out:

The answer lies in the use of HashMap class (or any other implementation of the Map interface.)

Hope this works for you!
16 years ago
This in response to your specific queries (others have mentioned the fundamental concepts above, understanding which is a must for any java newbie )

Raj said
Questions 1) why do i have ti use RETURN V; i know i have used a String as return type ....... but when i removed t hat return type it gives me error
and correspondingly in the statement R.REMOVE(R.CHECK) it givesme error THE METHOD REMOVE(STRING) IS UNDEFINED FOR THE TYPE REM.

2) if we use the above code which is working then i have some fundamentals to be clear

i am calling r.remove(r.check) and corresponding to that line in the called function is public Strin remov(strin c) .......... domnt u think i should pass the whole class here.........

Answer 1 :
You need not "return v" - just make the return type of your "remove" method "void" and try out the same code after commenting out "return v".
The thing is since you have explicitly mentioned your return type as String so you MUST return a String.

Answer 2 :
Another important aspect is your vocabulary ... "pass the whole class here" ... you can never pass a class. Please learn how to phrase that question correctly. Though you have been given the answer by Layne.
16 years ago
The most important about your question (in case you havent figured it out yet !) ... is not achieving the objective you had planned but learning the concepts that you inadvertently hit upon:
1. that Java is always pass-by-value
2. that String is immutable
3. use/abuse of instance variables (you havent answered to Layne's poser yet !?)
16 years ago
Thanks Stan! ... for that nifty idea and explaining the actual mechanism to be used.

And Fred, I am not going to make use of it anywhere in actual coding but as you said Stan has explained the method in a lucid manner and it was Stan who tickled my curiosity about this hitherto unkown method.

Layne, I was'nt referring to "funda" of using maps but the "funda" of Stan's idea ... which I have understood now.

Thanks all!!
16 years ago
Thanks for the response Friedman (and for that rap too!! ).

I just wanted a bookish explanation .. which turned to be a (important !?) property of readLine() method as explained by you.

I am sure the second piece of code as a question is good enough for any of the preliminary cert tests, what say?
16 years ago