Course Content

Course Content

Description

Operators in Java

In our previous video of our ongoing course for Core Java we have learnt that what is Array and declaration of Array with types of Array in Java. Now in this video we are going to see what are Operators in Java programming language and also about the Arithmetic operator in Java.

Operator in Java is a symbol that is used to perform different operations while programming. There are different types of operators present in Java like -

  • Arithmetic operators
  • Relational operators
  • Bitwise operators
  • Logical operators
  • Conditional operators
  • Assignment operators

Arithmetic operators in Java are used in mathematical expression.

  • '+' : Adds two operands
  • '-' : Subtract second operands from first
  • '*' : Multiply two operand
  • '/' : Divide numerator by denominator
  • '%' : Reminder of division
  • '++' : Increment operator increases integer value one by one
  • '--' : Decrement operator decreases integer value one by one

Now we will do Programming for Arithmetic operators in Java.
class arithmetic
{
public static void main (String[] args)
{
int a=10,b=3;
int sum=a+b;
System.out.println("addition is" + sum);
int sub=a-b;
System.out.println("subtraction is" + sub);
int mul=a*b;
System.out.println("multiplication is" + mul);
float div=a/b;
System.out.println("division is" + div);
}
}
Output :
addition is 13
subtraction is 7
multiplication is 30
division is 3.0

So, in this video we have seen that what are Operators in Java with Arithmetic operator in Java. In the next video we will take a look on Relational Operators in Java with it’s practical example.

FAQs

Recommended Courses

Share With Friend

Have a friend to whom you would want to share this course?

Download The Apps

Code Scan or Download the app
Google Play Store
297K+ Downloads
4.5 Rating
10K+ Reviews
  • Learn anywhere on the go
  • Get regular updates about your enrolled or new courses
  • Share content with your friends
  • Evaluate your progress through practice tests
  • No internet connection needed
  • Enroll for the webinar and join at the time of the webinar from anywhere