“Is a” versus “Has a”

Don’t confuse inheritance with nesting (having a member that refers to another object). Declaring an object as a data field inside a class just sets up a reference variable to the object with no special privileges or relationship. In contrast, inheritance says the subclass is a variation of the superclass that extends its semantics in

Reading columns of a table

String jdbcDriver = "oracle.jdbc.driver.OracleDriver"; String dbConnection = "xxx"; try { OracleDataSource oracleDataSource = new OracleDataSource(); oracleDataSource.setURL(dbConnection); connection = oracleDataSource.getConnection(); String selectQuery = "SELECT * FROM TABLENAME"; Statement statement = connection.createStatement(); ResultSet resultSet = statement.executeQuery(selectQuery); ResultSetMetaData resultSetMetaData = resultSet.getMetaData(); int col = resultSetMetaData.getColumnCount(); for (int i = 1; i <= col; i++){ System.out.println( "Column name: "+

Primitive types and Literals

There are 8 primitive types boolean char int long byte short double float Boolean: one bit minimum capacity and has the value of true and false. Char: 16 bit unsigned quantity hold character values. Range of value is 0 to 65,535. Int: 32 bit signed quantity holds numbers. Range of value is -2,147,483,648 to 2,147,483,647.