Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: ha qunaa
Added: Jul 29, 2021 3:08 PM
Views: 758
Tags: no tags
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package javacore;
  7.  
  8. /**
  9.  *
  10.  * @author admin
  11.  */
  12. public class Function {
  13.     public static void main(String[] args) {
  14.         System.out.println(tinhTong());
  15.         int a = 8;
  16.         int b = 19;
  17.         int hieu = tinhHieu(a, b);
  18.         System.out.println(hieu);
  19.        
  20.         inThongBao();
  21.     }
  22.    
  23.     public static int tinhTong(){
  24.         int a = 5,b = 7;
  25.         int sum = a+b;
  26.         return sum;
  27.     }
  28.    
  29.     public static int tinhHieu(int a, int b){
  30.         int hieu = a - b;
  31.         return hieu;
  32.     }
  33.    
  34.     public static void inThongBao(){
  35.         System.out.println("Thong bao!");
  36.     }
  37. }
  38.