![]() ![]() ![]() Must be declared as public, otherwise JVM won't be able to find the main method in your program and your program will not execute. ![]() JVM at the time of program execution that is why it Methods declared with public keyword can be accessed outside the class. That decides the visibility or accessibility of a member. Public - The keyword public is an access modifier Java to get more detail about blocks in java. Refer static and instance initializer blocks in MyFirstProgram is the name of class, everything that is inside balanced. Programmers need to write the name of the class which is used to refer that class within or outside the class. Your program won't compile, java compiler will throw compilation error. What if I use keywords as my variable, class or method name ?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |