Embarking on the Backend Development Journey: Starting With Core Java And Spring Boot
BEGINING MY JAVA LEARNING JOURNEY: DAY-1 JAVA INTRODUCTION
1. What is Backend web development?
2. What is Java?
3. Why Java programming Language is named java?
4. Why use Java?
5. What is JDK?
6. what is JRE?
7. What is JVM?
8.What are the top Java Features?
9. How to Run a java Program in Command Prompt ?
Let's create a Java program and run it using the Command Prompt
Step 1: Open the notepad
Step 2: Write a Java program that you want to compile and run. We have written the following code in the notepad.
Step 3: To save a Java program press Ctrl + S key and provide the file name. Remember that the file name must be the same as the class name followed by the .java extension.
Step 4: To compile and run a Java program, open the Command Prompt .
Step 5: In the Command Prompt window, write the following commands.
领英推荐
Step 6: To compile the Java program type the following command:
javac HelloWorld.java
Step 7: To run the Java program, type the following command.
java HelloWorld
10. Explain public static void main(String args[]) in Java.
public: the public is the access modifier responsible for mentioning who can access the element or the method and what is the limit. It is responsible for making the main function globally available. It is made public so that JVM can invoke it from outside the class as it is not present in the current class.
static: static is a keyword used so that we can use the element without initiating the class so to avoid the unnecessary allocation of the memory.
void: void is a keyword and is used to specify that a method doesn’t return anything. As the main function doesn’t return anything we use void.
main: main represents that the function declared is the main function. It helps JVM to identify that the declared function is the main function.
String args[]: It stores Java command-line arguments and is an array of type java.lang.String class.
11. what is Java Comments?
Single-line Comments
Example
// This is a comment
System.out.println("Hello World");
This example uses a single-line comment at the end of a line of code:
Example
System.out.println("Hello World"); // This is a comment
Java Multi-line Comments
Example
/* The code below will print the words Hello World
to the screen, and it is amazing */
System.out.println("Hello World");