viki Bhardwaj

Ranch Hand
+ Follow
since Nov 07, 2011
viki likes ...
Java
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
25
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by viki Bhardwaj

Hi All,

I am here to ask one doubt, previously i tried to resolve myself by searching google as well coderanch but did not found the answer. I have also posted my problem to www.stackoverflow.com you can have a look here but i did not get any reply. it may be, the way of asking a problem was not correct because it was my first question which i post over stackoverflow so there can be some mistake from my side.
here the problem is -i am using MultiActionController and trying to add up different methods having return type of (ModelAndView | Map | String | void).. here is the sample code what am i doing..


now the problem is- what happen if method returns a Map instance then how the view will be decided. for this i opened MultiActionController docs and found interesting facts ,there is a bean named DefaultRequestToViewNameTranslator is responsible to open default view so i tried to keep it in my dispatcher-servlet.xml file as below:



but when i request url /customer/returnMap.htm then found HTTP-404 error showing requested resource /..../returnMap.jsp not available while i have included returnMap.jsp in the WEB-INF/jsp/ .
so i am missing something here but unable to figure it out so please help me for :

1-how to configure view to show when MultiActionController's method return Map instance.?
2- and the last is how to configure in the case of method returns void.


thanks
10 years ago

Richard Tookey wrote:

viki Bhardwaj wrote:
1-he asked me that when we print object reference through sop statement then it prints like Student@736e84 where 736e84 is hexadecimal representation of hashcode



Not necessarily true since a hash code can be up to 32 bits and 6 hex digits is only 24 bits and I have seen system generated 32 bit hash codes. Also, since the JVM can move objects in memory it is not even a simple cut down representation of the address. Other than to suggest once again that you look at the OpenJDK source I can't help. To my mind, life is too short to worry about this irrelevant implementation detail and I suggest that it would be more productive for you to spend your spare time learning more of the language details.




Hi Richard,
Thanks for your reply. I am agree with your point and the thing which i want to know is-
does student object get manage by hashtable data structure internally??
i hope you make me clear my doubt.

thanks
10 years ago

Richard Tookey wrote: why do you need to know?



First i like to say thanks for your reply,
Yes, i am curious to know about, because i faced a question asked by one of my colleague.we were discussing over hashcode() and equals() method .let me explain about confusion we discussed.
1-he asked me that when we print object reference through sop statement then it prints like Student@736e84 where 736e84 is hexadecimal representation of hashcode
and we know that in hashtable objects are inserted according to their hashcode.
so in the student case it prints along with hashcode so does student object also maintain by hashtable data structure??
really i am unable to get what would be the right answer.
please help..

regards:
-viki
10 years ago
Hi Ranchers!

Here i am going to ask a question that may be very easy for all but i am curious to know.
the question is- when we create a new object of any class(like class Demo) then by which data structure it going to maintain by JVM.
let me elaborate my issue. suppose i have a normal class Student and i am going to create an object of Student class, so i know that the newly created instance will get memory inside heap.



student will get memory inside heap, that is fine but by which data structure ??? please make me clear my doubt by posting your answer.
Thanks for your time.

-----------------------------------------------------------------------------------------------------------------------------------------------------
viki
10 years ago

Jeanne Boyarsky wrote:Viki,
Has it ever worked? If so, have you installed any plugins since?

If you aren't using a clean workspace, try that first. That will either solve your problem or narrow it down to the Eclipse side.




Thanks for your reply.
Yes, recently i installed plugin for oracle weblogic and after that IDE prompt me for to restart IDE and i said ok, after restarting the IDE it asked for workspace location , as i choose then automatically
the IDE disappearing again and again . i have been googled for my particular problem but i did not get. please help me .

ragards:
Viki
Hello Everyone,

i am using eclipse juno latest release when i am trying to start is then it is showing me error an error has occurred. see the log file F:/eclipse/.metadata/.log
when i follow the directory and open the log file then its showing following log messages



eclipse.buildId=M20130204-1200
java.version=1.7.0_25
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product -clean

!ENTRY org.eclipse.e4.ui.workbench 4 0 2013-09-19 13:01:48.601
!MESSAGE Unable to create class 'org.eclipse.e4.core.commands.CommandServiceAddon' from bundle '262'
!STACK 0
org.eclipse.e4.core.di.InjectionException: java.lang.ClassCastException: Cannot cast org.eclipse.core.commands.CommandManager to org.eclipse.core.commands.CommandManager
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:63)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:861)
at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:113)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:321)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:255)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:185)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:105)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:71)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:49)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:258)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:557)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
Caused by: java.lang.ClassCastException: Cannot cast org.eclipse.core.commands.CommandManager to org.eclipse.core.commands.CommandManager
at java.lang.Class.cast(Unknown Source)
at org.eclipse.e4.core.internal.contexts.EclipseContext.get(EclipseContext.java:561)
at org.eclipse.e4.core.commands.CommandServiceAddon.init(CommandServiceAddon.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
... 26 more

!ENTRY org.eclipse.e4.ui.workbench 4 0 2013-09-19 13:01:48.621
!MESSAGE Unable to create class 'org.eclipse.e4.ui.internal.workbench.addons.CommandProcessingAddon' from bundle '275'
!STACK 0
org.eclipse.e4.core.di.InjectionException: Unable to process "CommandProcessingAddon.commandService": no actual value was found for the argument "ECommandService".
at org.eclipse.e4.core.internal.di.InjectorImpl.reportUnresolvedArgument(InjectorImpl.java:396)
at org.eclipse.e4.core.internal.di.InjectorImpl.resolveRequestorArgs(InjectorImpl.java:387)
at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:102)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:321)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:255)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:185)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:105)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:71)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:49)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:258)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:557)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)

!ENTRY org.eclipse.e4.ui.workbench 4 0 2013-09-19 13:01:48.636
!MESSAGE Unable to create class 'org.eclipse.e4.ui.workbench.swt.util.BindingProcessingAddon' from bundle '278'
!STACK 0
org.eclipse.e4.core.di.InjectionException: Unable to process "BindingProcessingAddon.commandService": no actual value was found for the argument "ECommandService".
at org.eclipse.e4.core.internal.di.InjectorImpl.reportUnresolvedArgument(InjectorImpl.java:396)
at org.eclipse.e4.core.internal.di.InjectorImpl.resolveRequestorArgs(InjectorImpl.java:387)
at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:102)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:321)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:255)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:185)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:105)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:71)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:49)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:258)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:557)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)

!ENTRY org.eclipse.osgi 2 0 2013-09-19 13:01:54.000
!MESSAGE One or more bundles are not resolved because the following root constraints are not resolved:
!SUBENTRY 1 org.eclipse.osgi 2 0 2013-09-19 13:01:54.000
!MESSAGE Bundle reference:file:plugins/org.eclipse.persistence.jpa_2.4.2.v20121206-a9d0e8d.jar was not resolved.
!SUBENTRY 2 org.eclipse.persistence.jpa 2 0 2013-09-19 13:01:54.000
!MESSAGE Missing imported package javax.persistence_[1.1.0,2.2.0).
!SUBENTRY 2 org.eclipse.persistence.jpa 2 0 2013-09-19 13:01:54.002
!MESSAGE Missing imported package javax.persistence.metamodel_[1.1.0,2.2.0).
!SUBENTRY 2 org.eclipse.persistence.jpa 2 0 2013-09-19 13:01:54.002
!MESSAGE Missing imported package javax.persistence.spi_[1.1.0,2.2.0).
!SUBENTRY 2 org.eclipse.persistence.jpa 2 0 2013-09-19 13:01:54.002
!MESSAGE Missing imported package javax.persistence.criteria_[1.1.0,2.2.0).

!ENTRY org.eclipse.osgi 2 0 2013-09-19 13:01:55.282
!MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry for the root cause if it exists:
!SUBENTRY 1 org.eclipse.osgi 2 0 2013-09-19 13:01:55.282
!MESSAGE Bundle org.eclipse.jpt.dbws.eclipselink.core.gen_1.0.1.v201208222210 [436] was not resolved.
!SUBENTRY 2 org.eclipse.jpt.dbws.eclipselink.core.gen 2 0 2013-09-19 13:01:55.282
!MESSAGE Missing required bundle org.eclipse.persistence.dbws.builder_[2.3.0,3.0.0).
!SUBENTRY 1 org.eclipse.osgi 2 0 2013-09-19 13:01:55.282
!MESSAGE Bundle org.eclipse.jpt.dbws.eclipselink.ui_1.0.201.v201208222210 [437] was not resolved.
!SUBENTRY 2 org.eclipse.jpt.dbws.eclipselink.ui 2 0 2013-09-19 13:01:55.282
!MESSAGE Missing required bundle org.eclipse.jpt.dbws.eclipselink.core.gen_[1.0.0,2.0.0).
!SUBENTRY 2 org.eclipse.jpt.dbws.eclipselink.ui 2 0 2013-09-19 13:01:55.282
!MESSAGE Missing required bundle org.eclipse.persistence.dbws.builder_[2.3.0,3.0.0).
!SUBENTRY 1 org.eclipse.osgi 2 0 2013-09-19 13:01:55.282
!MESSAGE Bundle org.eclipse.persistence.dbws_2.4.2.v20121206-a9d0e8d [657] was not resolved.
!SUBENTRY 2 org.eclipse.persistence.dbws 2 0 2013-09-19 13:01:55.282
!MESSAGE Missing required bundle org.eclipse.persistence.jpa_2.4.2.
!SUBENTRY 1 org.eclipse.osgi 2 0 2013-09-19 13:01:55.282
!MESSAGE Bundle org.eclipse.persistence.dbws.builder_2.4.2.v20121206-a9d0e8d [658] was not resolved.
!SUBENTRY 2 org.eclipse.persistence.dbws.builder 2 0 2013-09-19 13:01:55.282
!MESSAGE Missing required bundle org.eclipse.persistence.dbws_2.4.2.
!SUBENTRY 2 org.eclipse.persistence.dbws.builder 2 0 2013-09-19 13:01:55.282
!MESSAGE Missing imported package org.eclipse.persistence.dbws_2.4.2.
!SUBENTRY 2 org.eclipse.persistence.dbws.builder 2 0 2013-09-19 13:01:55.282
!MESSAGE Missing imported package org.eclipse.persistence.internal.dbws_2.4.2.
!SUBENTRY 2 org.eclipse.persistence.dbws.builder 2 0 2013-09-19 13:01:55.282
!MESSAGE Missing imported package org.eclipse.persistence.internal.xr_2.4.2.
!SUBENTRY 2 org.eclipse.persistence.dbws.builder 2 0 2013-09-19 13:01:55.282
!MESSAGE Missing imported package org.eclipse.persistence.internal.xr.sxf_2.4.2.
!SUBENTRY 2 org.eclipse.persistence.dbws.builder 2 0 2013-09-19 13:01:55.282
!MESSAGE Missing optionally imported package org.eclipse.persistence.tools.oracleddl.metadata_1.0.0.
!SUBENTRY 2 org.eclipse.persistence.dbws.builder 2 0 2013-09-19 13:01:55.283
!MESSAGE Missing optionally imported package org.eclipse.persistence.tools.oracleddl.metadata.visit_1.0.0.
!SUBENTRY 2 org.eclipse.persistence.dbws.builder 2 0 2013-09-19 13:01:55.283
!MESSAGE Missing optionally imported package org.eclipse.persistence.tools.oracleddl.parser_1.0.0.
!SUBENTRY 2 org.eclipse.persistence.dbws.builder 2 0 2013-09-19 13:01:55.283
!MESSAGE Missing optionally imported package org.eclipse.persistence.tools.oracleddl.util_1.0.0.
!SUBENTRY 1 org.eclipse.osgi 2 0 2013-09-19 13:01:55.283
!MESSAGE Bundle org.eclipse.persistence.jpa_2.4.2.v20121206-a9d0e8d [659] was not resolved.
!SUBENTRY 2 org.eclipse.persistence.jpa 2 0 2013-09-19 13:01:55.283
!MESSAGE Missing imported package javax.persistence_[1.1.0,2.2.0).
!SUBENTRY 2 org.eclipse.persistence.jpa 2 0 2013-09-19 13:01:55.283
!MESSAGE Missing imported package javax.persistence.criteria_[1.1.0,2.2.0).
!SUBENTRY 2 org.eclipse.persistence.jpa 2 0 2013-09-19 13:01:55.283
!MESSAGE Missing imported package javax.persistence.metamodel_[1.1.0,2.2.0).
!SUBENTRY 2 org.eclipse.persistence.jpa 2 0 2013-09-19 13:01:55.283
!MESSAGE Missing imported package javax.persistence.spi_[1.1.0,2.2.0).
!SUBENTRY 2 org.eclipse.persistence.jpa 2 0 2013-09-19 13:01:55.283
!MESSAGE Missing optionally imported package javax.transaction_1.1.0.
!SUBENTRY 2 org.eclipse.persistence.jpa 2 0 2013-09-19 13:01:55.283
!MESSAGE Missing optionally imported package javax.transaction.xa_1.1.0.
!SUBENTRY 2 org.eclipse.persistence.jpa 2 0 2013-09-19 13:01:55.283
!MESSAGE Missing optionally imported package javax.validation_0.0.0.
!SUBENTRY 2 org.eclipse.persistence.jpa 2 0 2013-09-19 13:01:55.283
!MESSAGE Missing optionally imported package javax.validation.groups_0.0.0.

!ENTRY org.eclipse.osgi 4 0 2013-09-19 13:01:55.288
!MESSAGE Application error
!STACK 1
java.lang.NullPointerException
at org.eclipse.e4.ui.internal.workbench.E4Workbench.processHierarchy(E4Workbench.java:172)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.init(E4Workbench.java:118)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.<init>(E4Workbench.java:69)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:306)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:557)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)





here i am not getting any idea that how can resolve the problem , need your help .

thanks for your time.

regards:
vivek
Forgot to post server log which displaying as bellow:

10 years ago
Hi All,

I am new in struts, and i am developing a simple struts login application and when i am trying to deploy it on oracle weblogic 10 then it shows following errors:


I am using Netbeans 7, Oracle weblogic 10.
but the same struts app is deploying successfully and working nicely over apache tomcate without displaying any errors.....
so please, could any body help me that what should do?
thanks for your time to read this thread.

regards:
vivek
10 years ago
Hi everyone,
I want to know that how to write a matrix into text file?
actually here i am trying to write a program which take no of rows and columns from user and also element of matrix and then i want to store that matrix into a separate file(abc.txt) and it's Transpose result
want to store in separate file(xyz.txt). for this i am stuck in, i am not getting idea that how to save my matrix into a file...
i have been searched regarding of my this problem but did not find any clue . let me post my code whatever effort i did to do...




please help me,
10 years ago

Campbell Ritchie wrote:You use the hash code to decide which bucket to put the object into in a hash based data structure. If you go through this thread, you will (I hope) find out how it is used.


thank you so much Campbell , for such link it was much enough talking about the point.
11 years ago

Campbell Ritchie wrote:No it isn't. There is nothing unique about hash codes at all. Look at this recent thread where that sort of thing is discussed.


lokesh sree wrote:
I will redirect the OP to the javadoc for more clarity.. http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html#hashCode()



thanks Campbell and lokesh for such a link it was nice to have a more understanding.
11 years ago

Jeff Verdegan wrote:

viki Bhardwaj wrote:as i know hashCode is unique no



The hashCode() method returns an int. There are 4,294,967,296 different possible int values.

There is an object called Long, which has 18,446,744,073,709,551,616 different possible values.

Based on this alone, the pigeonhole principle tells us that hashCode() values cannot possibly be unique. When you start to bring in Strings and more complex object graphs, it becomes even more obvious.



Thanks Jeff, now i understood as you explained but here i have one more doubt .....as i know after object creation object goes to bucket based on their hashcode and for each bucket there is a unique hashcode, a bucket can hold more than one object means two objects can be hold with the same hashcode value so here want to know that:

how does java make every object unique?
11 years ago
Hello everyone!,
i am curious to know that can it be possible ,two different object have same hashcode?.. i am confused that how hashCode() method works.
and how the jvm allocates unique value to object. let me explain my understanding about hashCode:
as i know hashCode is unique no which is generated by jvm during object creation based on the address of an object to provide uniqueness.
and hashCode() is a non final method so we can override and can give our implementation so if once i have overridden the haashCode() then what will happen about uniqueness .
please correct me if i am wrong in above statement and please help me to clear my doubts by posting your reasonable answer.
thanks for your time to given for this post.

_____________________________________________________________________________ -vivek
11 years ago


Class.forName("com.jdbc.mysql.Driver");



I corrected, actually i had taken wrong qualified diver name as above ,now code is running fine...
thanks .
Please help me, still i am waiting for your valuable reply that would be helpful to resolve my problem , really i am curious to learn that how to work with wamp server to develop web application ,but i am stuck in a very common problem which i have posted above already.....please help me. i would be very thankful to your help.