Q&A
Ask and answer questions to make information more available to wider audiences.
Aarav Carpenter @carpenteraarav   30, Jun 2023 12:00 AM
‘new' operator VS ‘newInstance()' operator
How is the ‘new' operator different from the ‘newInstance()' operator in java?
answers 1
 
Answer 1
Noah Antills @noahantills   07, Jul 2023 02:23 PM
Both the new operator and the newInstance() method are used to create objects in Java. If we already know the kind of object to create, we can use the new operator; however, if the type of object to create is supplied to us at runtime, we must use the newInstance() function.