Meaning of Null in Java and SQL code -
hi i'm little bit confused code, want know if why value of object connection
, resultset
, preparedstatement
null
? can help me explain what's function of each code below? , why null
?
public class loginform extends javax.swing.jframe { connection conn=null; resultset rs=null; preparedstatement pst=null; public loginform() { initcomponents(); conn = sqlconnnector.connectdb(); } }
they beingness set null explicit. alternative declare them this:
connection conn; resultset rs; preparedstatement pst;
either way statements doing allocating space in memory object. later initialized in line:
conn = sqlconnector.connectdb();
java
No comments:
Post a Comment