Ruby

Java is a popular programming language, created in 1995.
It is owned by Oracle, and more than 3 billion devices run Java.
It is used for:

  • Mobile applications (specially Android apps)
  • Desktop applications
  • Web applications

Java
  1. Java works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc.)
  2. It is one of the most popular programming language in the world
  3. It has a large demand in the current job market
  4. It is easy to learn and simple to use
  5. It is open-source and free
  6. It is secure, fast and powerful
  7. It has a huge community support (tens of millions of developers)
  8. Java is an object oriented language which gives a clear structure to programs and allows code to be reused, lowering development costs
  9. As Java is close to C++ and C#, it makes it easy for programmers to switch to Java or vice versa
  1. Java Syntax
    Java Syntax
    The curly braces {} marks the beginning and the end of a block of code.

    System is a built-in Java class that contains useful members, such as out, which is short for "output". The println() method, short for "print line", is used to print a value to the screen (or a file).

    Don't worry too much about System, out and println(). Just know that you need them together to print stuff to the screen.

    You should also note that each code statement must end with a semicolon (;).
                         
                            public class Main {
                                public static void main(String[] args) {
                                  System.out.println("Hello World");
                                }
                              }
                            
    
  2. Print Text
    Print Text
    1) The Print() Method
    There is also a print() method, which is similar to println().
    The only difference is that it does not insert a new line at the end of the output


    2) Println()
    You can add as many println() methods as you want. Note that it will add a new line for each method

    Print()

                     
                    System.out.print("I will print on the same line.");
                
            

    Println()

                     
                    System.out.println("Hello World!");
                
            
  3. Java Comments
    Java Comments
    Comments can be used to explain Java code, and to make it more readable. It can also be used to prevent execution when testing alternative code.

    Single-line Comments
    Single-line comments start with two forward slashes (//).
    Any text between // and the end of the line is ignored by Java (will not be executed).

    Java Multi-line Comments
    Multi-line comments start with /* and ends with */.
    Any text between /* and */ will be ignored by Java.

    single linecomment

        
            // This is a comment
    
    

    Multi-Line comments

        
            /* The code below will print the words Hello World
    to the screen, and it is amazing */