Saturday 19 September 2015

Java Tutorial : Java Parameters


Click here to watch in Youtube :
https://www.youtube.com/watch?v=0gZLmoed5KM&list=UUhwKlOVR041tngjerWxVccw

Click the below Image to Enlarge
Java Tutorial : Java Parameters
Student.java
public class Student
{
    /*
     * marksScoredInScience,marksScoredInEnglish are parameters.
     */
    public int getTotalMarks(int marksScoredInScience, int marksScoredInEnglish)
    {

        int totalMarks = marksScoredInScience 
                    + marksScoredInEnglish; // Local Variable
        return totalMarks;
    }
}
StudentDemo.java
public class StudentDemo
{

    public static void main(String[] args)
    {
        Student student = new Student();
        int totalMarksOftheStudent = student.getTotalMarks(50,40);
        System.out.println("Total Marks : "+totalMarksOftheStudent);
    }

}
Output
Total Marks : 90
To Download VariableDemoParamApp Project Click the below link
https://sites.google.com/site/javaee4321/java/VariableDemoParamApp.zip?attredirects=0&d=1

See also:
  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • No comments:

    Post a Comment