Hello it seems so easy.. Isn't it??
Lets start..
we have in Java only pass by value not by reference..
*public class Testing *
*{*
* public static void main(String[] args)*
* {*
* int a=5;*
* System.out.println("values = " + a);*
* value(a);*
* System.out.println("values = " + a);*
*
*
* }*
*
*
* private static void value(int a)*
* {*
* a=10;*
* System.out.println("values = " + a);*
* *
* }*
*}*
*
*
output :
values = 5
values = 10
values = 5
Right??
now come to the point
*public class Testing *
*{*
* public static void main(String[] args)*
* {*
* ResultSet rset= conn.createStatement().executeQuesry("....");*
*
*
*
value(rset);
*
*
*
*
**
// if here we try to access the rset, it says its close or something else..
*
* // Right?? if in Java there s o call by reference then why
local variable rset is not working here?? *
* }*
*
*
* private static void value(ResultSet a)*
* {*
* while(a.next())*
* {*
* ..*
* ..*
* ..*
* }*
* }*
*}*
--
You received this message because you are subscribed to the Google Groups "Java
Posse" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/javaposse.
For more options, visit https://groups.google.com/groups/opt_out.