Showing posts with the label Java Programming

Write a java program for multiplying two matrices and print the product for the same | WaoFamHub

Two matrices and print the product for the same. INPUT public class Matrix1{  public static void main(String args[]){    int a[][]={{1,1,1},{2,2,2},{3,3,3}}…

Read more

Write a java program to add two matrices and print the resultant matrix | WaoFamHub

Add two matrices and print the resultant matrix. INPUT public class Matrix{ public static void main(String args[]){  int a[][]={{1,3,4},{2,4,3},{3,4,5}};  …

Read more

Write a java program to implement multiple inheritance | WaoFamHub

Multiple Inheritance. INPUT interface Car {     int speed=60;     public void distanceTravelled(); } interface Bus {     int distance=100;     public…

Read more

Write a java program to implement method overriding | WaoFamHub

Method Overriding INPUT class Human{      public void eat()    {       System.out.println("Human is eating");    } } class Boy extends Human…

Read more

Write a java program to implement single level inheritance. | WaoFamHub

Single Level Inheritance.  INPUT class Single{  static int num1=10;  static int num2=5; } class Main extends Single{  public static void main(String[] a…

Read more

Write a java program to demonstrate the implementation of abstract class. | WaoFamHub

Implementation of Abstract Class. INPUT import java.util.Scanner; abstract class test { abstract void get(); } class test1 extends test { void get() …

Read more

Designed a class that demonstrates the use of constructor and destructor. | WaoFamHub

Constructor And Destructor. INPUT class Square{ int width,height; Square( int a , int b){ width = a; height = b; } int area(){ return width * height; }…

Read more

Designed a class SortData that contains the method asec() and desc(). | WaoFamHub

The Method asec() And desc(). INPUT import java.util.*; class prac4A { Scanner input=new Scanner(System.in); int num,i; int arr[]; int temp=0; public vo…

Read more
That is All