Java Tutorial #16 — Introduction to methods

Topics Discussed: Methods, passing by value, method arguments, return types, void Source Code for Lesson 16: /** * * @author Damien Bell <SkyeShatter@gmail.com> */ import java.util.Scanner; class Jtutorial1 { public static int prodSum(int x, int y){ int z=0; System.out.println("The product is: " +(x*y)); // produdct of our numbers z= x+y; return z; } public static... » read more

Java Tutorial #17 — Encapsulating programs // including more than 1 file

Topics discussed: Encapsulation by separating methods into new files. Source Code Available Here Program encapsulation The concept of program encapsulation is simple: break things down into their component parts so when something breaks, it’s easy to track, and easier to fix. The more ‘parts’ you break your program into (via methods) the easier this becomes.... » read more

Java Tutorial #18 — Access Modifiers; Working with / around them

Topics discussed: Access modifiers, public, private, static Source Code Available Here Access modifiers Access modifiers are our way of sectioning off our program and making it harder to accidentally use / misuse methods not contained within the calling class. There are 4 access modifiers and they basically work like this: Public: Public as an access... » read more