Shashank Gollapudi

Ranch Hand
+ Follow
since Jan 19, 2012
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 Shashank Gollapudi

This has nothing to do with pass by value, what is happening here is, you may not be passing the arguments the way you wanted to.

Here is how it is happening
On your line 15

you are always passing the second and third arguments as 0

Math.random() always returns a double value equal to 0.0 and less than 1.0.

here you are casting on Math.random() to an integer value and then multiplying with either 9 or 10.
TO be clear, you are calling ((int)Math.random())*9 = 0 * 9 (always)

So it is as simple as calling swap(array, 0, 0 )
6 years ago
You can use regex of the format \d{3}-?\d{3}-?\d{4} where \d represents a numeric digit and the number in the curly braces indicate the number of digits that are possible.
for example \d{3} should contain three digits.
? (this indicates the character preceding can be ignored or can be used once). In our case -(dash) can be either ignored or can be used once.
6 years ago
Your text file might not have been in the classpath
6 years ago
Open startup batch file and have "pause" on the last line of the file,

THis would stop the window until you press any key.
6 years ago
My application that accepts attachments requires those to be scanned for viruses before processing on the server.
WE have used McAfee UVScan for this where using the command line argument

i was able to scan a file and get the desired output. But my question here is if i have an InputStream instead of a file, how can i run the scan?

I was thinking to write the stream to a temporary file on the server and run the scan? But i am not totally convinced by this approach.

Documentation for this is
6 years ago

just FYI, whenever a constructor is invoked for a class, the first statement in a constructor is a call to the parent class default constuctor although nothing explicitly has been mentioned.

SO even under this case when your constructor for Bottom2 class is invoked, the first statement is substituted with super() which is a call to the super class no-arg constuctor.

So to overcome the below error you have two options
1) Define a no-arg constructor in parent Top Class
2) Make an explicit call to existing constructor of Top class

For example use your constructor of Bottom2 class as follows
6 years ago

Here in this case, after the execution of line 3 you have a reference to an array of size three whose contents are null, as you haven't mentioned the second dimension in the array definition.

nums2[0] points to first element in the array which is null and nums2[0][0] gives you a null pointer exception.

Instead you can alternatively mention the second dimension or give nums[0] = new int[4]; before your line 4.
7 years ago
Rest everything like add, remove etc are from the Collection interface which List interface extends
7 years ago
HI Shivaja,

The error on the line 45 from your code is you are instantiating a subclass for an abstract class which is not completely defined. Use the following way instead

Secondly the error on line 54 is you are trying to restrict the access modifier, as the methods in an interface are always public , where as you are changing it to default access.

Please let me know if something is unclear
7 years ago
Hi Roberts,

The return type of the following methods (Coordinate,Profile,SystemInfo,Commodity) are not defined for the class, and these four are the cause of your 23 errros.

Try importing them if they are external references.

7 years ago
try replacing
public boolean compare(int time){


public boolean compare(Time time){
7 years ago

Bear Bibeault wrote:

Shashank Gollapudi wrote:As you already have the values in the JSP, i think you can directly use them using jsp expressions

Not good advice. Using scriptlets in a JSP is an obsolete and outdated poor practice that should no longer be encouraged. I think 12 years is plenty of time to come up to speed on the EL!

Thanks for correcting me Bear, i would take your advice
7 years ago
As you already have the values in the JSP, i think you can directly use them using jsp expressions

7 years ago

Rajnikant Panchal wrote:Hi..

I unable to remove jar from my maven project so build is not possible.

so help me to remove jar.

What do you mean by unable to remove a jar ? can you just be a little more specific on this?
7 years ago

pramod talekar wrote:Hi,

I'm using s:iterator and need to put radio button on every row/record returned
This is my code :

The problem with the above code is that it displays accountNo e.g. 123, 456 etc. next to it's radio button. I need to remove it.
Please advise.

Replace your radio button line with

<td><s:radio name="selectedId" list="#{'accountNo':''}" theme="simple"></s:radio></td>
7 years ago