Solved Examples of Methods - Part 1 | ICSE Computer Applications | Java & BlueJ

preview_player
Показать описание
In this video, we see the different types of Java methods. We will get hands on and learn about writing method prototype based on the question, coding the method body and finally executing it in BlueJ.

Рекомендации по теме
Комментарии
Автор

2:53, Sir for this question below is my program, quite different from yours.Please Suggest any changes (if any) in the greatest() method as I've directly used if else for returning the value instead of initialising it in g in the 1st method.

import java.util.Scanner;
public class Demo
{
public static int greatest(int a, int b)
{
if(a>b)
return a;
else
return b;
}
public static void main(String[]args)
{
Scanner sc = new Scanner(System.in);
int n1 = sc.nextInt();
int n2 = sc.nextInt();
int g=greatest(n1, n2);
System.out.println(g);
}
}

randomcontents
Автор

sir can you make a video on function overloading

aditiagarwal
visit shbcf.ru