-
How we are able to access the createStatement(); method
Connection con = DriverManager.getConnection(..................);
*Statement st = con.createStatement();
*Connection,Statement are interfaces and all the methods are abstract methods. Then how we are able to access the createStatement(); method (which is an abstract method) , since we did not provide any implementation in subclass nor implemented Connection interface. How can we use the methods.
Question asked by visitor Sudheer Martha
-
Junior Member
Re: How we are able to access the createStatement(); method
DriverManager.getConnection() returns a concrete implementation of the Connection Interface.
Similarly, calling createStatement() on the connection object (the concrete connection implementation) returns you a concrete implementation of the Statement.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules