How to create an object in two statements Syntax
ClassName variableName; variableName = new ClassName(argumentList);Example with no arguments
Product = product; product = new Product();How to create an object in one statement
ClassName variableName = new ClassName(argumentList); ******************************************************* Product product = new Product(); Product product = new Product("java"); Product product = new Product(productCode); Product product = new Product(code, description, price); ******************************************************* | | | | | | | | | | | | | | | | | | | | | |