0% found this document useful (0 votes)
37 views

Class Basepro: Package Import

JAVA PROGRAM TO FIND THE TRANSPOSE OF A MATRIX (A transpose of an array obtained by interchanging the elements of the rows and columns) . WITH COMMENTS AND DETAILS TO HELP YOU UNDERSTAND THEM.THIS PROGRAM HAS BEEN RUN ON BlueJ AND IS ERROR FREE.IT WILL SURELY HELP YOU IN STUDYING JAVA PROGRAMS FOR EXAMS OR OTHERWISE.

Uploaded by

AMRENDRA SINGH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Class Basepro: Package Import

JAVA PROGRAM TO FIND THE TRANSPOSE OF A MATRIX (A transpose of an array obtained by interchanging the elements of the rows and columns) . WITH COMMENTS AND DETAILS TO HELP YOU UNDERSTAND THEM.THIS PROGRAM HAS BEEN RUN ON BlueJ AND IS ERROR FREE.IT WILL SURELY HELP YOU IN STUDYING JAVA PROGRAMS FOR EXAMS OR OTHERWISE.

Uploaded by

AMRENDRA SINGH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Class basePro

1/1

package Inheritance.sample1;
import java.io.*;
public class basePro
{
float n1;
float n2;
DataInputStream d=new DataInputStream(System.in);
void enter()throws IOException
{
System.out.println("ENTER NUMBER");
n1=Float.parseFloat(d.readLine());
System.out.println("ENTER NUMBER");
n2=Float.parseFloat(d.readLine());
}
void show()
{
System.out.println("NUMBER 1="+n1);
System.out.println("NUMBER 2="+n2);
}
}

Jan 17, 2015 9:40:19 AM

Class dervPro

1/1

package Inheritance.sample1;
import java.io.*;
public class dervPro extends basePro
{
float result;
DataInputStream d=new DataInputStream(System.in);
void prod()throws IOException
{
enter();
result=n1*n2;
}
void disp()
{
System.out.println("MULTIPLICATION RESULT="+result);
}
}

Jan 17, 2015 9:40:40 AM

Class run

1/1

package Inheritance.sample1;

import java.io.*;
public class run
{
DataInputStream d=new DataInputStream(System.in);
public void main() throws IOException
{
dervPro obj1=new dervPro();
obj1.prod();
obj1.disp();
}
}

Jan 17, 2015 9:41:01 AM

run1.main();
ENTER NUMBER
6
ENTER NUMBER
3
MULTIPLICATION RESULT=18.0
run1.main();
ENTER NUMBER
12
ENTER NUMBER
8
MULTIPLICATION RESULT=96.0

You might also like