answersLogoWhite

0

What is purpose of keyword new?

Updated: 8/11/2023
User Avatar

Wiki User

15y ago

Best Answer

The keyword new is used to instantiate or create Java class objects.

ex:

String empName = new String("Rocky");

The above statement creates a new String object of name empName and value as Rocky

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

new is used to make a new instance of that class. a class is an abstract concept. You need to make an instance if you want to use it.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is purpose of keyword new?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is a new keyword in java methods?

new is a keyword to create a instance of object any class.


What is the use of keyword new used in AWT programming?

what is the use of new keyword in awt programming


What is the purpose of the keyword private?

The private keyword is used to ensure that no other classes will be able to access (view or modify) that class member.


What is the main purpose of a keyword tool?

The main purpose of a keyword tool is to help simplify the searching process, make suggested or related terms and show most common related items that others have used.


What does the new function do?

The new keyword creates a new Object.


What is new keyword in c?

enum, void and const are relatively new keywords in Cnew, on the other hand, isn't a keyword in C


What would be the main purpose of using a PPC keyword tool?

Google Keyword planner is the best keyword tool for PPC. Google Keyword Planner is a free tool that allows you to uncover potential keywords for your campaign. This is one of the most reliable tools for PPC keyword research and analysis. Google is the best search engine across the globe.


What is the significance of keyword 'new' in instance creation?

It's not just a keyword, it is also an operator in instance creation. This operator starts the sequence of constructing a new instance of object.


What keyword is using to create objects?

In C# and Visual Basic.NET the keyword is "new". C doesn't have such an animal, but you generally use the library call to malloc to get new memory.


What keyword is used to invoke user-defined exceptions?

throw is the keyword used to invoke the exception.throw new NoBalanceException("No balance please");


What is the purpose of keyword bidding?

The purpose of keyword bidding is to increase traffic to ones website. Some websites allow bidding on certain keywords, which make the bidders website more likely to show up when these words are entered into the search bar. This way a website gets more visitors.


What is the purpose of the keyword void in a function declaration?

when we declare any function with void,it doesnt return any value