java_courses

Find the area of triangle and rectangle in java

Find the area of triangle and rectangle in java Week 6 a)Aim: To Write java program to create a super class called Figure that receives the dimensions of two dimensional objects. It also defines a method called area that computes the area of an object. The program derives two subclasses from Figure. The first is …

Find the area of triangle and rectangle in java Read More »

Java Print function with example | Difference between print () and println () in java

Java Print function with example | Difference between print () and println () in java Java print Both the print () and println () methods print data on the screen. Basically print () and println () are almost identical with very little difference between them. These methods are very popular in Java. Difference between print …

Java Print function with example | Difference between print () and println () in java Read More »

What is the Fibonacci series? in java | Displaying the Fibonacci sequence using a loop

What is the Fibonacci series? in java | Displaying the Fibonacci sequence using a loop What is the Fibonacci series? In the Fibonacci series, the next number is the sum of the previous two numbers. The first two numbers in the Fibonacci series are 0 and 1. Fibonacci numbers are used significantly in computational run-time …

What is the Fibonacci series? in java | Displaying the Fibonacci sequence using a loop Read More »

To calculate Area of Circle in java program

To calculate Area of Circle in java program Area of Circle in java The following Java program to print the area of a circle has been written in five simple different ways, static method, using constructor, Interface, inheritance with sample outputs for each program. Source Code import java.io.*; import java.util.*; class Area { public static …

To calculate Area of Circle in java program Read More »

Java Addition through user input

Addition through user input value In this program, you’ll learn to store and add two integer numbers in Java. After addition, the final sum is displayed on the screen. Source code import java.io.*; import java.util.*; class Add { public static void main(String[] args) { Scanner ob=new Scanner(System.in); System.out.println(“enter value of a and b”); int x,y; …

Java Addition through user input Read More »

Addition program in java with source code

Addition of two number in this  program user will not  enter number form the keyboard. Value is fixed and you can see out put on the screen Source Code import java.io.*; import java.util.*; class Add { public static void main(String[] args) { //Scanner ob=new Scanner(System.in); System.out.println(“given value of a=5 and b=8”); int a=5 int b=8 …

Addition program in java with source code Read More »