Java Tutorial For Beginners 6 – Math and Arithmetic Operators in Java

Java

Video is ready, Click Here to View ×


For Code used in this lesson click – http://www.codebind.com/java-tutorials/math-and-arithmetic-operators-in-java/

Java – Basic Operators
Basics of the Java operators
Searches related to java math operators
java math class
java math operators power
java math operators exponential
java math functions
java square root
java not equal to operator
java math division remainder
java arithmetic operators order
Assignment, Arithmetic, and Unary Operators
Basics of the Java operators
Java Or…

33 thoughts on “Java Tutorial For Beginners 6 – Math and Arithmetic Operators in Java

  1. Using the user enter method:

    package first;
    import java.util.Scanner;
    public class MyProgram{
    public static void main(String[] args) {
    int x,y,ans;
    System.out.print("PLEASE ENTER THE FIRST NUMBER : ");
    Scanner a = new Scanner(System.in);
    x = a.nextInt();
    System.out.print("PLEASE ENTER THE SECOND NUMBER : ");
    Scanner b = new Scanner(System.in);
    y=b.nextInt();
    ans = x+y;
    System.out.println("Your required value is = " + ans);
    }
    }

  2. Thanks Sir. But I'm the beginner to learn of class tenth ICSE student. so, I WILL be thankful to you If u say from the basic i. e., from elementary concept of classes & object, History and development of Java

  3. I have a question for someone that can help
    why use
    System.out.println("Answer = " + answer);
    instead of just
    System.out.println(answer);
    I need a more in depth explanation,I know he mentions it concatenates the values but how and why does it benefit the coder?
    Thanx!

  4. package Lesson1;

    public class arithmetic_operators {
    public static void main(String[] args) {
    int x, y;
    double answer;
    x = 70;
    y = 30;
    answer = x / y;
    System.out.println("answer = " + answer);
    }
    }

    why is this returning "answer is 2.0" I thought the answer should be like 2.33. Please explain

Leave a Reply

Your email address will not be published. Required fields are marked *