Click here to watch in Youtube :
https://www.youtube.com/watch?v=Z_zljJ9bvMI&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
Java Tutorial : Java Local Variable |
public class Student { public int getTotalMarks() { int marksScoredInScience = 80; // Local Variable int marksScoredInEnglish = 90; // Local Variable int totalMarks = marksScoredInScience + marksScoredInEnglish; // Local Variable return totalMarks; } }
public class StudentDemo { public static void main(String[] args) { Student student = new Student(); int totalMarksOftheStudent = student.getTotalMarks(); System.out.println("Total Marks : "+totalMarksOftheStudent); } }
Total Marks : 170
https://sites.google.com/site/javaee4321/java/VariableDemoLocalApp.zip?attredirects=0&d=1
See also:
No comments:
Post a Comment