Loading video...
Classes, Objects, and Methods
- Java uses Classes, Objects, and Methods in order to perform tasks
- Classes contain the general information about the program, whereas Objects are specific instances of Classes.
- Methods are sets of instructions that tell the classes and objects what to do
- Java has a small set of Primitive Data Types which define basic data such as text and numbers
- All data types can be used as declared variables
- When an object is initialized for the first time, a Constructor is used to specify attributes
Classes, Objects, and Methods
Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.
- Intro
- Classes, Objects, and Methods
- Instance Variables
- Set and Get Methods
- Primitive Types vs. Reference Types
- Constructors
- Example 1: Prints a Table of Squares and Cubes From 0 to 10
- Example 2: Bank Account Class with Constructor
- Example 3: Create and Change Account Object
- Example 4: Bank Account Debit Function
- Example 5: Debit Account Balance Program
- Example 6: Hardware Store Inventory & Invoice
- Example 7: Hardware Store Inventory & Invoice Main Class

































2 answers
Last reply by: Mick Coyne
Wed Oct 10, 2012 10:09 PM
Post by Jethro Jones on February 27, 2011
I'd really like to have the sample code for these lessons so that I can follow along and tweak on my computer while I watch.
0 answers
Post by Matthew Lipman on October 19, 2011
Dear Hillstrom, seems u are smart by nature, easy to understand anything from you : )
i have a question, can you provide leasson for Java SWING!?
Thanks :)
0 answers
Post by Tanaroek Thanaaphiwong on July 7, 2012
what happens if the number of each account becomes 0, even though they are written 500 or 100 on the page. does anyone know how to fix this problem
0 answers
Post by Jacob Mack on August 6, 2012
Maury, I notice you do not capitalize like so:
public class AccountCredit. To have public class accountcredit from what I understand could cause a compile error, but I could be mistaken. Thank you for taking time out to clarify this. I really enjoy working watching and working on programming with your videos.
0 answers
Post by Jacob Mack on August 6, 2012
I apologize as I was able to get public class accounntcredit to compile. I guess most textbooks just use the capital letter naming convention.
3 answers
Last reply by: Annette Hoult
Sat Oct 27, 2012 6:33 PM
Post by Sergio Gutierrez on August 22, 2012
what is this Printf?? this drives me crazy!!
1 answer
Wed Nov 7, 2012 6:38 PM
Post by Keron John on November 7, 2012
I need to know where is the other class being called exactly in the code, I mean the precise lines in the code that are calling the other class, as I'm trying to do this and failing miserably.
0 answers
Post by mustafa aloqayli on December 23, 2012
Java is not hard but some people try to show you that you have to be very smart to get what is java ... i'm really sorry for the people who comes here and pay money to start with, privet, or high level code which is a big puzzle for people who came to start from zero ??
you just moved from " Hello World " to use private and calling method
you starting with puzzle code
I wish if I can speak English to teach you guys introduction to Java
0 answers
Post by Ovanes Mikaelian on January 4 at 08:57:58 PM
After setting up the "public class accountcredit", which extension do we use to save the file - .class or .java? Thank you.
0 answers
Post by Jonathan Rugel on February 4 at 05:28:33 AM
He's a bore
0 answers
Post by Jonathan Rugel on February 4 at 05:29:29 AM
He's very vague with his lessons. :(
0 answers
Post by Naeif Rafeh on March 6 at 08:57:12 PM
I have problem from the Calendar class I have no idea why Ecleps did now recognized the Clendar Class
or did not import the Calendar class
0 answers
Post by Michael McDermott on March 12 at 02:34:53 PM
This is not teaching. The instructor narrates code which includes concepts that have not been taught.
0 answers
Post by JOSEPH PELLAM on March 18 at 02:27:01 PM
I copied your code for the Squaresandcubes code but the following code for 1 thru 0:
System.out.printf("%d\t%d\t%d
"), x, (x * x), (x * x * x ));
x = 1;
Generates the following error for each line as follows:
C:\Users\jpellam.DEVELOPMENT\Documents\NetBeansProjects\squaresandcubes\src\squaresandcubes\Squaresandcubes.java:24: not a statement
System.out.printf("%d\t%d\t%d
"), x, (x * x), (x * x * x ));
C:\Users\jpellam.DEVELOPMENT\Documents\NetBeansProjects\squaresandcubes\src\squaresandcubes\Squaresandcubes.java:24: ';' expected
Not sure what I am missing. Thanks
0 answers
Post by Phil Wyder on March 18 at 05:01:59 PM
can a float or a double be negative? For example: -21.23234