Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Curso de Java Netbeans Completo☕ [48.- POO retornar valores desde un …
…metodo] Video: https://youtu.be/To3aumjrB0w
- Loading branch information
1 parent
0abe2ea
commit a386f18
Showing
2 changed files
with
56 additions
and
12 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
src/main/java/com/programadornovato/proy1/Calculadora.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package com.programadornovato.proy1; | ||
|
||
/** | ||
* | ||
* @author eugenio | ||
*/ | ||
public class Calculadora { | ||
public int suma(int a,int b){ | ||
int res=0; | ||
if(a>0 && b>0){ | ||
res=a+b; | ||
} | ||
return res; | ||
} | ||
public int resta(int a,int b){ | ||
int res=0; | ||
if(a>0 && b>0){ | ||
res=a-b; | ||
} | ||
return res; | ||
} | ||
public int multiplicacion(int a,int b){ | ||
int res=0; | ||
if(a>0 && b>0){ | ||
res=a*b; | ||
} | ||
return res; | ||
} | ||
public int divicion(int a,int b){ | ||
int res=0; | ||
if(a>0 && b>0){ | ||
res=a/b; | ||
} | ||
return res; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters