Methods (Exercise 1)

preview_player
Показать описание
Java Programming: Method Overloading in Java Programming
Topics Discussed:
1) Writing a method that gets the name of the user and a method that gets the age of the user.

Music:
Axol x Alex Skrindo - You [NCS Release]

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

I love how he made examples simple to understand

admoonhermiz
Автор

I did it like this and it worked
public static void main(String[] args) {

System.out.println("Enter your name & age: ");
Scanner s = new Scanner(System.in);

System.out.println( "name: " + userName(s.nextLine()));
System.out.println( "age: " +userAge(s.nextShort()));

}


public static String userName(String name) {

return name;



}

public static int userAge(int age) {

return age;

}

human-qchi
Автор

bro I didn't know you're lebanese until now ! haha, good to know tho. Much appreciated man for the videos.

FitWithShamas
Автор

wasnt able to do this exercise on my own

riteshmadishetty
Автор

Sir plzzz upload videos on electrical machine- 2

indumeena
Автор

Are u going to upload Java Swing tutorials also??

bhushanpawar
Автор

Find the biggest root of a number in C.What is the mathematical logic of this code??

pijushpatra
Автор

*IS THIS CODE WRONG? IF YES WHY?..*
Scanner n=new Scanner(System.in);
int age;
String name;

System.out.print("Enter your name and age: ");
"+getAge(n.nextInt()));

}

public static String getName(String name)
{
return name;
}

public static int getAge(int age)
{
return age;
}

shahidaibrahim