Setup a Java Programming development environment and test using small program.

1.Write installation directory path of your directory?
Ans:
On Windows
C:\Program File
C:\Program File\Java
2.Write value of path environment variable?
Ans:
C:\Program File(*86)\comman files\oracle\Java\javapath;java\jdk\bin;java\jre\bin;

3.List the folder created after installation.
Ans:
Shivam

4.Main method is declared as Static.Justify.
Ans:
Or
The main method in Java is the first programming method, a Java programmer knows when it starts learning the Java programming language. Have you ever thought about why the main method in Java is public, stable and zero, of course, yes, because most of us learn first. And compared to C ++, we go to Java in our programming path, which we introduce in the main method, but Java is slightly different in the method because it does not return a value in C as it is int, the main method is public Why is static and zero? In this post we will try to find answers to these questions and one of the most popular questions in Java is an idea why the main method has been declared static.
Or
The main method is always stable because non-static members or methods should not be called directly with the class name. When compiling a Java program, we are giving the main class .. class name with the keyword "java", java <main class class_name> by calling "main class name" by jvm directly to the main method And executes the way. By putting "stable" we are providing the main method to execute JVM. In Java 7 version jvm will first search for "main method".

5.Program is named with class containing main method.Justify
Ans:
Let's say when you create a program in which more than one class lives. After compiling and compiling the Java source file, it will generate the same .class file in the same number because the classes live in your program. In this condition, you will not be able to easily identify which class needs to be interpreted by the Java interpreter and which category is with entry point (main method) for the program. You can take a look at the source code for the class name and then you should find the classname in which the main method remains. So it would be very tedious work for any one. Therefore we are compelled to follow the rules to make the compiler easier to find other sections in the beginning because it is not a search for all potential thousands of class files for a random public class, it can just go to the file.
Best Practice - There are many public classes in the same file, things get confused. The purpose of the files is to organize the source code, the purpose of folders is to organize the files. If all classes of a particular package are in a single 100 MB super file, you will lose all the advantages and have not availed any of the files (as well as adding a lot of headaches while editing)
This is just a convention created by Java, the creator of Java and the objectives of the program so it is quick to find the source and class files for compilation and runtime; The reason is that all people holding code in Java will have a consistent way of naming files.
So in the end we say this statement that the name of the file should be similar to the name of the class so that it can be ensured that there is no confusion during compiling and running the program.

Comments