Deprecated: Creation of dynamic property Kirki_Toolkit::$modules is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/kirki.php on line 67

Deprecated: Creation of dynamic property Kirki_Field_Switch::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Textarea::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Switch::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Checkbox::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Toggle::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Radio::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Checkbox::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Custom::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Custom::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Switch::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Radio_Image::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Radio::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Multicheck::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Switch::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Number::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Checkbox::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Switch::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Text::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Radio_Image::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Multicheck::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Switch::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Checkbox::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Checkbox::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Switch::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Switch::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Switch::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Switch::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Radio_Image::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Custom::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Deprecated: Creation of dynamic property Kirki_Field_Custom::$label is deprecated in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php on line 291

Warning: Cannot modify header information - headers already sent by (output started at /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-content/themes/hitmag/inc/kirki/core/class-kirki-field.php:291) in /home/rh00k03md44z/public_html/new.octopuscodes.com/wp-includes/feed-rss2.php on line 8
Java Archives - OctopusCodes https://octopuscodes.com/category/java/ Tue, 13 Jun 2023 09:16:10 +0000 en-US hourly 1 https://wordpress.org/?v=6.9 https://octopuscodes.com/wp-content/uploads/2022/12/cropped-logo-80x80-1-32x32.png Java Archives - OctopusCodes https://octopuscodes.com/category/java/ 32 32 Install Java on Windows for Hibernate https://octopuscodes.com/java/hibernate-tutorial/basic-hibernate/install-java-on-windows-for-hibernate/ Tue, 23 May 2023 03:13:08 +0000 https://octopuscodes.com/?p=2381 Step 1: Open your browser and type https://www.oracle.com/java/technologies/downloads/ Step 2: Click on “Yes” button. Step 3: Click on “Next” button Step 4: Click on “Next” button Step 5: Click on …

The post Install Java on Windows for Hibernate appeared first on OctopusCodes.

]]>
Step 1: Open your browser and type https://www.oracle.com/java/technologies/downloads/

Step 2: Click on “Yes” button.

Step 3: Click on “Next” button

Step 4: Click on “Next” button

Step 5: Click on “Next” button

Step 6: Click on “Close” button

The post Install Java on Windows for Hibernate appeared first on OctopusCodes.

]]>
Install MySQL for Hibernate https://octopuscodes.com/java/hibernate-tutorial/install-mysql-for-hibernate/ Tue, 23 May 2023 03:10:19 +0000 https://octopuscodes.com/?p=2378 Step 1: Open your browser and type https://www.apachefriends.org/download.html and download XAMPP installer. Step 2: Follow the instructions to install XAMPP. Step 3: To start XAMPP, type XAMPP into the search …

The post Install MySQL for Hibernate appeared first on OctopusCodes.

]]>
Step 1: Open your browser and type https://www.apachefriends.org/download.html and download XAMPP installer.

Step 2: Follow the instructions to install XAMPP.

Step 3: To start XAMPP, type XAMPP into the search bar. Then select the XAMPP Control Panel to start XAMPP.

Step 4: The Start button for Apache is used to start the Apache web server (and then stop it when it is started). The Start button for MySQL will start the MySQL database (and then stop it when it is started).

The post Install MySQL for Hibernate appeared first on OctopusCodes.

]]>
Download and Install Eclipse to Run Hibernate https://octopuscodes.com/java/hibernate-tutorial/download-and-install-eclipse-to-run-hibernate/ Tue, 23 May 2023 03:02:41 +0000 https://octopuscodes.com/?p=2374 Step 1: Open your browser and type https://www.eclipse.org/ Step 2: Click on “Download” button. Step 3: Click on “Download 64 bit” button Step 4: Click on “Download” button Step 5: …

The post Download and Install Eclipse to Run Hibernate appeared first on OctopusCodes.

]]>

Step 1: Open your browser and type https://www.eclipse.org/

Step 2: Click on “Download” button.

Step 3: Click on “Download 64 bit” button

Step 4: Click on “Download” button

Step 5: Click on “eclipse-inst-win64.exe” file to install Eclipse

Step 6: Click on “Eclipse IDE for Java Developers

Step 7: Click on “INSTALL” button

Step 8: Click on “LAUNCH” button.

The post Download and Install Eclipse to Run Hibernate appeared first on OctopusCodes.

]]>
Write a Java program to print the area and perimeter of a square https://octopuscodes.com/java/java-tutorial/basic-java/write-a-java-program-to-print-the-area-and-perimeter-of-a-square/ Wed, 01 Feb 2023 08:47:58 +0000 https://octopuscodes.com/?p=1215 This example will provide how to print the area and perimeter of a square in Java. Example: package octopuscodes.com.demo; import java.util.Scanner; public class Demo { public static void main(String[] args) …

The post Write a Java program to print the area and perimeter of a square appeared first on OctopusCodes.

]]>
This example will provide how to print the area and perimeter of a square in Java.

package octopuscodes.com.demo;

import java.util.Scanner;

public class Demo {

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		System.out.print("a: ");
		double a = scanner.nextDouble();

		double area = a * a;
		double perimeter = a * 4;

		System.out.println("Area : " + area);
		System.out.println("Perimeter : " + perimeter);

	}

}
a: 5
Area : 25.0
Perimeter : 20.0

    The post Write a Java program to print the area and perimeter of a square appeared first on OctopusCodes.

    ]]>
    Write a Java program to print the area and perimeter of a rectangle https://octopuscodes.com/java/java-tutorial/basic-java/write-a-java-program-to-print-the-area-and-perimeter-of-a-rectangle/ Wed, 01 Feb 2023 08:43:10 +0000 https://octopuscodes.com/?p=1207 This example will provide how to print the area and perimeter of a rectangle in Java. Example: package octopuscodes.com.demo; import java.util.Scanner; public class Demo { public static void main(String[] args) …

    The post Write a Java program to print the area and perimeter of a rectangle appeared first on OctopusCodes.

    ]]>
    This example will provide how to print the area and perimeter of a rectangle in Java.

    package octopuscodes.com.demo;
    
    import java.util.Scanner;
    
    public class Demo {
    
    	public static void main(String[] args) {
    
    		Scanner scanner = new Scanner(System.in);
    		System.out.print("a: ");
    		double a = scanner.nextDouble();
    		System.out.print("b: ");
    		double b = scanner.nextDouble();
    
    		double area = a * b;
    		double perimeter = (a + b) * 2;
    
    		System.out.println("Area : " + area);
    		System.out.println("Perimeter : " + perimeter);
    
    	}
    
    }
    a: 3
    b: 10
    Area : 30.0
    Perimeter : 26.0
    

      The post Write a Java program to print the area and perimeter of a rectangle appeared first on OctopusCodes.

      ]]>
      Write a Java program to print the area and perimeter of a circle https://octopuscodes.com/java/java-tutorial/basic-java/write-a-java-program-to-print-the-area-and-perimeter-of-a-circle/ Wed, 01 Feb 2023 08:37:57 +0000 https://octopuscodes.com/?p=1200 This example will provide how to print the area and perimeter of a circle in Java. Example: package octopuscodes.com.demo; import java.util.Scanner; public class Demo { public static void main(String[] args) …

      The post Write a Java program to print the area and perimeter of a circle appeared first on OctopusCodes.

      ]]>
      This example will provide how to print the area and perimeter of a circle in Java.

      package octopuscodes.com.demo;
      
      import java.util.Scanner;
      
      public class Demo {
      
      	public static void main(String[] args) {
      
      		Scanner scanner = new Scanner(System.in);
      		System.out.print("Radius: ");
      		double radius = scanner.nextDouble();
      		double area = Math.PI * radius * radius;
      		double perimeter = 2 * Math.PI * radius;
      		System.out.println("Area : " + area);
      		System.out.println("Perimeter : " + perimeter);
      
      	}
      
      }
      Radius: 4
      Area : 50.26548245743669
      Perimeter : 25.132741228718345
      

        The post Write a Java program to print the area and perimeter of a circle appeared first on OctopusCodes.

        ]]>
        Write a Java program to convert Celsius into Fahrenheit https://octopuscodes.com/java/java-tutorial/basic-java/write-a-java-program-to-convert-celsius-into-fahrenheit/ Wed, 01 Feb 2023 08:33:21 +0000 https://octopuscodes.com/?p=1193 This example will provide how to convert Celsius into Fahrenheit in Java. Example: package octopuscodes.com.demo; import java.util.Scanner; public class Demo { public static void main(String[] args) { Scanner scanner = …

        The post Write a Java program to convert Celsius into Fahrenheit appeared first on OctopusCodes.

        ]]>
        This example will provide how to convert Celsius into Fahrenheit in Java.

        package octopuscodes.com.demo;
        
        import java.util.Scanner;
        
        public class Demo {
        
        	public static void main(String[] args) {
        
        		Scanner scanner = new Scanner(System.in);
        		System.out.print("Celsius: ");
        		double celsius = scanner.nextDouble();
        		double fahrenheit = celsius * 1.8 + 32;
        		System.out.println("Fahrenheit: " + fahrenheit);
        
        	}
        
        }
        Celsius: 100
        Fahrenheit: 212.0
        

          The post Write a Java program to convert Celsius into Fahrenheit appeared first on OctopusCodes.

          ]]>
          Write a Java program to convert Fahrenheit into Celsius https://octopuscodes.com/java/java-tutorial/basic-java/write-a-java-program-to-convert-fahrenheit-into-celsius/ Wed, 01 Feb 2023 08:27:07 +0000 https://octopuscodes.com/?p=1185 This example will provide how to convert Fahrenheit into Celsius in Java. Example: package octopuscodes.com.demo; import java.util.Scanner; public class Demo { public static void main(String[] args) { Scanner scanner = …

          The post Write a Java program to convert Fahrenheit into Celsius appeared first on OctopusCodes.

          ]]>
          This example will provide how to convert Fahrenheit into Celsius in Java.

          package octopuscodes.com.demo;
          
          import java.util.Scanner;
          
          public class Demo {
          
          	public static void main(String[] args) {
          
          		Scanner scanner = new Scanner(System.in);
          		System.out.print("Fahrenheit: ");
          		double fahrenheit = scanner.nextDouble();
          		double celsius = (fahrenheit - 32) / 1.8;
          		System.out.println("Celsius: " + celsius);
          
          	}
          
          }
          Fahrenheit: 212
          Celsius: 100.0
          

            The post Write a Java program to convert Fahrenheit into Celsius appeared first on OctopusCodes.

            ]]>
            Java Operators with Real Life Examples https://octopuscodes.com/java/java-tutorial/basic-java/java-operators-with-real-life-examples/ Wed, 01 Feb 2023 08:18:37 +0000 https://octopuscodes.com/?p=1178 This post will provide real life examples how to use operators in Java.

            The post Java Operators with Real Life Examples appeared first on OctopusCodes.

            ]]>
            This post will provide real life examples how to use operators in Java.

            The post Java Operators with Real Life Examples appeared first on OctopusCodes.

            ]]>
            Assignment Operators in Java https://octopuscodes.com/java/java-tutorial/basic-java/assignment-operators-in-java/ Mon, 30 Jan 2023 10:34:35 +0000 https://octopuscodes.com/?p=1143 In Java, assignment operators are used in Java to assign values to variables. Operator Example = c = d; += c += d; -= c -= d; *= c *= …

            The post Assignment Operators in Java appeared first on OctopusCodes.

            ]]>
            In Java, assignment operators are used in Java to assign values to variables.

            OperatorExample
            =c = d;
            +=c += d;
            -=c -= d;
            *=c *= d;
            /=c /= d;
            %=c %= d;

            1. (=) Operator

            This operator is used to assign the value on the right to the variable on the left.

            package octopuscodes.com.demo;
            
            public class Demo {
            
            	public static void main(String[] args) {
            		int a = 10;
            		System.out.println("a: " + a);
            		
            		double b, c, d, e;
            		b = c = d = e = 4.5;		
            		System.out.println("b: " + b);
            		System.out.println("c: " + c);
            		System.out.println("d: " + d);
            		System.out.println("e: " + e);
            		
            		double f = b + c;
            		System.out.println("f: " + f);
            	}
            
            }
            a: 10
            b: 4.5
            c: 4.5
            d: 4.5
            e: 4.5
            f: 9.0
            
             

            2. (+=) Operator

            This operator is a compound of “+” and “=” operators. It operates by adding the current value of the variable on the left to the value on the right and then assigning the result to the operand on the left.

            package octopuscodes.com.demo;
            
            public class Demo {
            
            	public static void main(String[] args) {
            		int a = 10;
            		a += 5;
            		System.out.println("a: " + a);
            	}
            
            }
            a: 15
            
             

            Best Keyboards for Programming

            3. (-=) Operator

            This operator is a compound of “-” and “=” operators. It operates by subtracting the variable’s value on the right from the current value of the variable on the left and then assigning the result to the operand on the left.

            package octopuscodes.com.demo;
            
            public class Demo {
            
            	public static void main(String[] args) {
            		int a = 10;
            		a -= 5;
            		System.out.println("a: " + a);
            	}
            
            }
            a: 5
            
             

            4. (*=) Operator

            This operator is a compound of “*” and “=” operators. It operates by multiplying the current value of the variable on the left to the value on the right and then assigning the result to the operand on the left.

            package octopuscodes.com.demo;
            
            public class Demo {
            
            	public static void main(String[] args) {
            		int a = 10;
            		a *= 5;
            		System.out.println("a: " + a);
            	}
            
            }
            a: 50
            
             

            5. (/=) Operator

            This operator is a compound of “/” and “=” operators. It operates by dividing the current value of the variable on the left by the value on the right and then assigning the quotient to the operand on the left.

            package octopuscodes.com.demo;
            
            public class Demo {
            
            	public static void main(String[] args) {
            		int a = 10;
            		a /= 5;
            		System.out.println("a: " + a);
            	}
            
            }
            a: 2
            
             

            6. (%=) Operator

            This operator is a compound of “%” and “=” operators. It operates by dividing the current value of the variable on the left by the value on the right and then assigning the remainder to the operand on the left.

            package octopuscodes.com.demo;
            
            public class Demo {
            
            	public static void main(String[] args) {
            		int a = 10;
            		a %= 5;
            		System.out.println("a: " + a);
            	}
            
            }
            a: 0
            

            The post Assignment Operators in Java appeared first on OctopusCodes.

            ]]>