kundana sharma

Greenhorn
+ Follow
since Sep 09, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by kundana sharma


At line 20 how many objects are available for Garbage collection?
My Ans is 2 objects will be Garbage Collected.But some say it to be 4.
My Solution:
s1--->SO1. At line 13.Lets acronym Sparrow Object as SO;
s2--->SO2. At line 14.
s3--->SO3. At line 15.
After line 16:s1--->SO3 ,s2--->SO2,s3--->SO3.So SO1 available for GC.
After line 17:s1--->SO3 ,s2--->SO3,s3--->SO3.So SO2 available for GC.
After line 18:s1--->SO3 ,s2--->null,s3--->SO3.
After line 19:As both s1 and s3 refer to same object, nothing much wrt GC is going to happen in this line.
Is this correct? some say 4 objects will be Garbage collected.
12 years ago
I am solving this problem:A user inputs a string consisting only alphabets and numbers (qqw123sfw33434).Now my job is to print an alphabet and a number like (q1q2w3s3f3w434) .I am able to extract both the both the Strings and integers into separate arrays.Now I need a logic to print one element of the array followed by another:
My code:

I know I am getting null pointer exception
12 years ago
Thank you .
I understood this after I posted the question.
This question is confusing me a lot.
Can some one clarify this.please explain both the cases:enabling assertions and disabling assertions.

Thanks Martin. e.printStackTrace() helped.I didn't iterate through ResultSet.I fixed it.
Will get back If some problem arises.
There is a table called Student whose structure is like this
ID (PK) (Number) | Name (varchar2) | Class (number) |
I am connecting to a remote Oracle db.\

My Question: an SQL exception when it comes to line no 19.(when I debug the cursor jumps to line no 26 from 19 )I am not able to figure out what is happening.
I know that there is problem with result set,but I am not able to fix it.
thank you in advance.
what does ^ do in java? I know that it is XOR which means it returns true only if both the arguments are true.
but I am not able to understand this.
public int xoring(int x,int y){
return (x^y);
what does this method do?please explain with an example.
The whole code snippet is this:
12 years ago
can you please explain what is happening from declaration of the 2d array through till end.
I am stuck here.

I am not able to make out What result set contains.Is it an array of ints?
please help Dey
My task:I want to calculate interest for an account_no at the end of the month.
Sample database:
Code for calculating interest:

I am not able to make out how to extract timestamp into result set and then use it.
please help.
I have a column name from_date as a timestamp in my Oracle Database.
Sample data:
The Question is How can I extract only the day part from the database using JDBC in java code.I mean I just need the '13' part in 13-Dec-12 7:41:54 PM ,'27' part in 27-Dec-12 7:41:54 PM.
I want the data to be in an array in increasing order.
please help I am not well versed in java.