Tag Archives: Java tutorial

Learn Java by Example: Java Program to Generate Multiplication Table

Java Program to Generate Multiplication Table In this program, you’ll learn to generate multiplication table of a given number. This is done by using a for and a while loop in Java.   Example 1: Generate Multiplication Table using for loop public class MultiplicationTable{ public static void main(String[] args){ int num = 5; for(int i …

Learn Java by Example: Java Program to Check Whether a Number is Positive or Negative

Java Program to Check Whether a Number is Positive or Negative In this program, you’ll learn to check whether a given number is positive or negative. This is done by using a if else statement in Java.   Example: Check if a Number is Positive or Negative using if else public class PositiveNegative{ public static …