Computer Science, asked by Manshi91, 1 year ago

write a code showing the use of new operator in java

it's urgent plz​

Answers

Answered by ayush12452
13

Answer:

New operator is used to allocate memory to a new object. It is used to create new objects.

Ex.ABC on=new ABC();

Explanation:

In the above example the code written is the creation of object where "ABC" is the name of the class and 'ob' is the name given to the new object which is created, thereafter the new operator is allocating memory to the newly created object 'ob' in the class "ABC".

Answered by dhruvashah771
0

Answer:

Scanner sc = new Scanner(System.in);

or

InputStreamReader read = new InputStreamReader(System.in);

Explanation:

Similar questions