Programacion para clase y subclases en java
package clases;
import java.io.*;
public class clases {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated methodstub
InputStreamReader Dato=new InputStreamReader(System.in);
BufferedReader Dato1=new BufferedReader(Dato);
double result,rest,rest1,mul,mul1,div,div1,sum1;
double param1,param2;System.out.println("GENERACION DE METODOS Y SUBMETODOS ");
operaciones ope = new operaciones();
result=ope.suma(10,20);
rest = ope.resta(10, 20);
mul = ope.multiplica(10, 20);div = ope.division(10, 0);
System.out.println("LA SUMA SIN PARAMETROS DE LA SUBCLASE ES: "+ result);
System.out.println("LA RESTA SIN PARAMETROS DE LA SUBCLASE ES: "+ rest);System.out.println("LA MULTIPLICACION SIN PARAMETROS DE LA SUBCLASE ES: "+ mul);
if(div==0)
System.out.println("LA DIVISION PARA CERO NO EXISTE");
else
System.out.println("LA DIVISION SINPARAMETROS DE LA SUBCLASE ES: "+ div);
operaciones ope1 = new operaciones(100, 0);
sum1= ope1.suma1();
rest1= ope1.resta1();
mul1= ope1.multiplica1();
System.out.println("LA SUMACON PARAMETROS DE LA SUBCLASE ES: "+ sum1);
System.out.println("LA RESTA CON PARAMETROS DE LA SUBCLASE ES: "+ rest1);
System.out.println("LA MULTIPLICACION CON PARAMETROS DE LA SUBCLASE ES: "+mul1);
div1= ope1.division1();
if(div1==0)
System.out.println("LA DIVISION PARA CERO NO EXISTE");
else
System.out.println("LA DIVISION CON PARAMETROS DE LA SUBCLASE ES: "+div1);
try
{
System.out.println("Ingreso de parametros desde teclado");
System.out.println("Ingrese el primer parametro");param1=Double.parseDouble(Dato1.readLine());
System.out.println("Ingrese el segundo parametro");
param2=Double.parseDouble(Dato1.readLine());
operaciones ope2 =new...
Regístrate para leer el documento completo.