write a code showing the use of new operator in java
it's urgent plz
Answers
Answered by
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
0
Answer:
Scanner sc = new Scanner(System.in);
or
InputStreamReader read = new InputStreamReader(System.in);
Explanation:
Similar questions
Math,
6 months ago
English,
6 months ago
India Languages,
6 months ago
Hindi,
1 year ago
Social Sciences,
1 year ago
Hindi,
1 year ago
Hindi,
1 year ago