Introduction To Programs and Java: Lund Amateur Coder's Club
Introduction To Programs and Java: Lund Amateur Coder's Club
Questions:
https://www.facebook.com/groups/533416536863723/?ref=aymt_h
omepage_panel
Introduction to Programs and Java What is
programming?
Java can be run on multiple programs inc Mac, Linux, Windows etc.
Introduction to Programs and Java What is
Object Oriented Programming?
Object oriented programming is a programming method that can
contain a varying number of objects that interact with each other
An object can be a list of books in the city library, each book listed
can in turn be another object with certain attributes
These attributes are descriptive properties such as author, publishing
date, number of pages, location within the library building, whether
it is lent out or available..
In order to see if the new Harry Potter book is available, you will ask
the library object to go through its list of books and return all new
Harry Potter books that are available.
In this process the library object will ask the book objects that are
relevant (new HP-book) whether they are free or not, to which the
books will return yes or no.
Introduction to Programs and Java What is
Object Oriented Programming?
If a book object returns a yes, then the library object will put the
book object in a list of available books.
You may have noticed that to close your command you need two
curvy brackets (opening & closing braces). This is because you
typically have functions within functions (different command blocks).
For example:
Here we assign values to integers a and b, and assign the value a+b to
integer c. Then we return (print) the value of c. The result will be
printed in the window below.
Errors will show up as red Xs on the left side of your coding screen.
Remember to check that your syntax is correct (using upper or lower
case correctly, open and close braces, semi-colons)
Introduction to Java, Assignment 1