The java org.eclipse.core.resources package is a part of the Eclipse Platform, which provides various APIs for handling resources and projects in the Eclipse workspace. The IProject interface is a part of this package which represents a project in the workspace.
The getName() method of IProject interface returns the name of the project as a string.
Example:
// Creating an IProject reference IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject("myProject");
//Printing the project name System.out.println(project.getName());
Output: myProject
Package library: org.eclipse.core.resources
In the above example, we first created a reference to an IProject using the getProject() method of the root workspace. Then, we printed the name of the project using getName() method.
Java IProject.getName - 30 examples found. These are the top rated real world Java examples of org.eclipse.core.resources.IProject.getName extracted from open source projects. You can rate examples to help us improve the quality of examples.