vaibhav panghal

Greenhorn
+ Follow
since Feb 24, 2008
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 vaibhav panghal

alright. The code that you have provided is pretty straight forward and simple to understand. But it still does make use of String object which is immutable. So the purpose of having "MutableString" has been defeated..!

But thanks anyways for trying to answer my query.

Actually I was thinking on the lines of string constant pool that JVM maintains. This is the space that it looks at whenever a String object is made. If it's content is available over there then it doesn't make a new String object and simply directs the String reference to that location.

So any better answers to my original query.

Thanks in advance for trying.

Regards,
Vaibhav
14 years ago
Hi all,

I am writing here after quite some time.
I am faced with a problem - what does String class actually do to make its objects immutable or in other words, how does StringBuilder(or StringBuffer) differ from String class in that their objects are mutable ?

I mean what code in String ( or StringBuffer, for that matter ) makes it behave the way it does behave ?

For example, lets assume that we only have String class in java that makes immutable objects and we don't have StringBuilder or StringBuffer for making mutable objects and we need that functionality. So how should I make my "MutableString" class so that when I make its objects they are mutable ??

I've been pondering over this for some time now.

Thanking in anticipation.


Regards,
Vaibhav
14 years ago
why is not anybody posting ? ok someone told me that implementing a firewall could be a good project . is that what you think ? would it involve databases ??
15 years ago
no i dont know any hibernate . i just want something of the level of jsp and servlets .

hi Fred . i dont want to do anything like games or anything to do with the itunes or word processor - thankyou for suggesting . we've thought of implementing an ERP system for our department . how does that sound ? But i think its going to get too huge to handle and make . wat say ? any more ideas ?? please keep them coming .
15 years ago
hi all
I am in my final year of Computer Science Engineering and we need to do a project . Last year I developed a compiler front-end in C but this time I want to do something in java so that it would help me in the industry as well when I get out of college .
We need to do a project that has some research involved in it . I want something that would involve databases as well since I've never worked with the database . Can anyone suggest me something ? Or am i on the wrong forum ?
Thanking in anticipation . Vaib .
15 years ago
great explanation marc . i too learnt some stuff . thank you .
15 years ago
yes i got all the concepts right . thank you so much .
15 years ago
yes i got what you are trying to say . in your simple illustration 1234567 is the simple format to store numbers like 1.234 x 10^567 ( and sucha format gives us the provision of representing huge numbers(although less precise) )
yes i know that ieee 754 is a much more complicated thing but your simple example shows the concept well enough . kindly stick to this thread for 2-3 days more . thank you .
15 years ago
hi marc ,
i am getting the feeling that i'll understand the concept with your explanation . but kindly help clear my doubts with what you written .
you've said that 1234567 can be stored as 1.234 x 10^567 . how is that ??
10^567 is a hell lot big dont you think . 1.234 x 10^6 could be used to store 1234567 (ofcourse , precision loss will be there too) . i am stuck at this point that's why i cannot carry on with your article . kindly help clarify the doubt . thank you . Vaib .
15 years ago
hi ,
although this question has been asked many times earlier also and i went through all the discussions in those threads but still i'm not able to figure it out exactly .
a long is 8 byte in size which means that its range is -2^63 to (+2^63)-1
a float is 4 byte long but i really do not understand its range .
i had a look at ieee 754 and also field values in the Float class but still could not get a hint . can someone help ??
15 years ago
all right i've decided to look further into this now . thank you anyway .
15 years ago
oh thank you so much Ernest . i was also thinking on the same lines - the compiler code remains the same , its just the change in application that invokes the compiler ( which is needed to be platform specific ) . thank you again . javaranch is a great place to be in .
15 years ago
all right i'll find it out myself and let you know .
15 years ago
hi Sidharth . hi Campbell .
all right i got some idea about it as Campbell said that its sort of a rule that's forced by the java compiler . but what i want to know is - why such a rule ?? why didn't we have such a rule in C++ ?? why - that's my real question
15 years ago
all right . that means i'm on the right path . i'll surely lookup JLS but the last time i browsed through it i cound not understand a word in it ( i am new to java ) . what's the right way to read the JLS ? thank you .
15 years ago