Santhosh Kumar

Ranch Hand
+ Follow
since Nov 07, 2000
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 Santhosh Kumar

Bottom line is that every time you mutate a String object, you get a brand new String object which is not same any other String objects created earlier (even if the content is same). So here s3 is new object and so is s4. That's why == comparison shows as false.
I don't think we can assume any compiler optimizations for the sake of exam. Otherwise, results can be different depending on which compiler user chooses. So work through the examples assuming details given only in the Java Language Specification.

Having said that and assuming no compiler optimizations, answer for this question is 5 and as follows. The list of objects/values shows the snapshot of heap after a corresponding statement is executed. (lost) indicates that object doesn't have a valid reference.

I'm working on a project which has tons of combo box fields, whose values are based on list of dynamic lookup values. For ex., we have Combox field "Division", whose values can be "Sales", "HR", "Marketing" etc., and these lookup values can be changed at runtime.

So to make life easier, I was hoping to develop a component lookupSelectOneMenu which would accept the lookup type like "Division" or "Country" and loads the combo box values dynamically using jsf backing bean.

I'm new to JSF so I don't know if this is the efficient way of doing and also if there is any prebuilt component available already.

Your thoughts and help is appreciated.
15 years ago
Loop in the java is better approach simply because you have full control in the Java itself to handle the error handling like logging a error log record into the db, moving file across to a error folder etc.

Moreover you will be starting the java for each file if you do in Shell script, which is unnecessary.
15 years ago
Enhanced for loop does one and only one thing, looping through all elements of an given array or Iterable object.

It is like, saying "for each object in the given array or iterable object, do something". While looping through the array or Iterable object, assigns the currently positioning element into given variable so that you access the element in the loop body.

Back to your code:

In the first loop, you are looping through the array and printing the array values.

In the second loop, you are looping through the array, using the values as index to select the array values.

First iteration, var i would be "9" and so array value at position "9" is "0"; That's what you are printing.
If you have to read Excel file, then there are some open source tools available which can read the file. You can graph whatever you want using JGraph or other graphics tools using the read you just read out.
15 years ago
Every array object belongs to a class which is type of created dynamically for every component type. For ex., one class for int[], one for String[] etc and all array object of a type share same class.

These array classes have member variable "public final length", which gives the number of elements in the array.

Read JLS section for more info.
First of all your question is not very clear as to what you asking for and people try to make good sense out of the question and tries to answer. If that is not what you expect, you can rephrase the question to make it clear or as you mentioned, you can try somewhere else too.
15 years ago
Why don't you construct the complete html using a variable and then finally set to innertHtml? Then you can even alert out the generated html to make sure it is what you expected?

Two cents.
As far as I know, you cannot directly travel to US without any approved employment and you cannot transfer the H1b to other employer without working here for a while (I think around 3 months) for the original employer.

However, don't take my advice but check out some immigration forums where you can get reliable information.
15 years ago
Bottom line is that whatever Java code you execute, JVM should never crash. If it does, it is just a JVM bug. So try to log a defect with Sun with all details and hopefully they will look into that.

To get going in your production, try to upgrade/downgrade the jvm to next/previous update and see if it fixes the issue. I think you would waste more time in debugging why it crashed than trying out newer/older JVM updates.
15 years ago
Trivial nitpick: Please use CODE tag to post the code snippets, which makes it easier to read.

When "//method" is reached only the object "Garbage g = new Garbage();" is ready for garbage collection.

Here important thing to understand is the when you pass a Reference type as a parameter, actual reference itself is not passed but the copy the reference.

So in method "go", you would be nullifying the copy of the reference and not the original reference "g1" itself.
Total medal count wise, USA but gold weight wise China.
15 years ago
Which container are you using?
15 years ago
I tried to run your code (ofcourse after changing the TAGFile to File and removing the TAGLogger), it worked fine. I zipped using the class and unzipped using Winzip without any issues.
15 years ago