answersLogoWhite

0

What does public mean in java?

Updated: 8/11/2023
User Avatar

Wiki User

14y ago

Best Answer

The keyword public is an access specifier. A variable or a method that is declared public is publicly accessible to any member of the project. Any class or method can freely access other public methods and variables of another class.

User Avatar

Wiki User

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

Wiki User

11y ago

If I understand your question, you want to know why the main method in java:

public static void main(String[] args)

is public, this is because when your program runs, the Java interpreter looks for the information on the location of the main method, then it looks for and runs the main method, but since it isn't in any class, it can't access any private methods, and therefore, the main method must always be public.

I hope I answered your question,

Mike

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

no public is not data type its accessor which publicaly access the classes or method

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

public is an access modifier in Java that allows all classes and methods uncontrolled access to the class or the variable that is defined with the keyword public in their definition.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What does public mean in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What was the name of the first version of Java?

Java 1.0a2 was the first public release.


When was Java developed?

Java was developed in the early 1990's by James Gosling at Sun Microsystems. Java was introduced to the public in 1995.


Can a .java file contain more than one java classes?

Yes, it can. However, there can only be one public class per .java file, as public classes must have the same name as the source file.


What is subroutine in java?

Subroutine mean what (in java)?


What implicit modifiers interface methods have in java?

public


What is psvm in java?

public static void main


What does Systemout mean in java?

System.out refers to the Java console.


What is the ticker symbol for Java Company?

The Java Brewing Company is not a public company and, thus, does not have a ticker symbol for trading.


How do you create a bean in Java?

In eclipse java beans can be created by using getters and setters. Example: public class Login { public String lmail; public String getLmail() { return lmail; } public void setLmail(String lmail) { this.lmail = lmail; }


How a class in java declared default?

default it is public type


In java public static voidmain function denotes what?

Java's main function denotes the entry point into the execution of your program.


What do you mean by multithread program in java?

A Program in Java that spawns multiple threads is called a multithreaded program in Java.