Course Introduction + Review Questions
Course Introduction + Review Questions
COSC1295/COSC2391
Advanced Programming/
Further Programming
2
RMIT Classification: Trusted
Class Times
Lectorials (week 1 – 12)
3
RMIT Classification: Trusted
Further Programming
• Monday Prac 14:30 – 16:30, online via Microsoft Teams
• Wednesday Prac 8:30 – 10:30, on campus 010.08.026
• Wednesday Prac 10:30 – 12:30, on campus 010.08.026
• Wednesday Prac 14:30 – 16:30, online via Microsoft Teams
• Thursday Prac 10:30 – 12:30, on campus 056.04.086-089
Advanced Programming
• Monday Prac 19:30 – 21:30, online via Microsoft Teams
• Tuesday Prac 10:30 – 12:30, on campus 014.11.037
• Wednesday Prac 16:30 – 18:30, on campus 010.08.026
4
RMIT Classification: Trusted
Queries
• Consultation
– For everyone: Tuesday 13:30 – 14:30 every
teaching week
– One-to-one: book via emails
• Please post your questions in the discussion
forum in Canvas
– Response is expected within 48 hours
5
RMIT Classification: Trusted
Course Objectives
• Prior Java programming experience is assumed
• Solve Complex problems
• Data Structures & Generics
• Object-oriented Concepts and Functional Programming
• Graphical User Interfaces and Event Handling via JavaFX
• Connect to Databases via JDBC
• Test your code with JUnit
• Introduce you to Design Patterns used in Industry
6
RMIT Classification: Trusted
Resources
• Recommended references:
– Y. Daniel Liang, Introduction To Java Programming and Data
Structures, 11th edition
– Yakov Fain, Java Programming: 24-Hour Trainer
• Canvas
– Weekly lecture notes and recordings (pre-class activities)
– Weekly lectorial notes
– Weekly practical lab materials
7
RMIT Classification: Trusted
Assessment
• Assignment 1 – 20%
– Smaller assignment designed to practice and demonstrate
developing a smaller Java program
• Assignment 2 – 45%
– Larger programming assignment, including OO Concepts, JCF,
JDBC (database connectivity), and a Graphical User Interface,
unit testing via the JUnit framework
• Multiple milestone submissions – 10%
– Submissions of code, in-lab demos/recorded presentations
explaining and executing the code, final interview
• Regular coding exercises during lectorials – 25%
– Week 5, 9, 12
8
RMIT Classification: Trusted
Plagiarism is an Offence
Plagiarism:
• 1. Submitting an assignment that contains other people’s work.
• 2. Helping other students to plagiarise.
To avoid plagiarism, you must give credit whenever you use
• another person’s idea, opinion, or theory;
• any facts, statistics, graphs, drawings - any pieces of information - that are
not common knowledge;
• quotations of another person’s actual spoken or written words; or
• paraphrase of another person’s spoken or written words.
9
RMIT Classification: Trusted
Syllabus
10
RMIT Classification: Trusted
Syllabus (cont.)
11
RMIT Classification: Trusted
12
RMIT Classification: Trusted
https://www.ibm.com/cloud/blog/jvm-vs-jre-vs-jdk
13
RMIT Classification: Trusted
IDEs
• You may use
– Eclipse (highly recommended)
– IntelliJ by JetBrains
– Microsoft’s Visual Studio Code
– NetBeans
• Eclipse IDE is available in scheduled RMIT
computer labs.
14
RMIT Classification: Trusted
Review Question 1
• What is the relationship between a class and an
object?
A class is a template or blueprint used in creating the
instances
An object is an instance of the class
15
RMIT Classification: Trusted
Review Question 2
• How long does the data stored in an object
persist? How is it different from local variables?
16
RMIT Classification: Trusted
Review Question 3
• What method is invoked for initialising the
data in an object?
Constructor method
Setter method if defined
public Account(String accountID, String accountName, double amount)
{
accID = accountID;
name = accountName;
balance = amount;
}
17
RMIT Classification: Trusted
Review Question 4
Constructor can return a value.
• True
• False
18
RMIT Classification: Trusted
Review Question 5
• How is an object accessed? Using reference variables
mum Account
dad Account
accID=“s123” accID=“g234”
name=“Mercy Brown” name= “David Brown”
balance=1000.0 balance=2000.0
mum = dad;
mum dad
Account Account
accID=“s123” accID=“g234”
name=“Mercy Brown” name= “David Brown”
balance=1000.0 balance=2000.0
19
RMIT Classification: Trusted
Review Question 6
• How do you decide what functionality should
be implemented in the superclass and what can
be left for the subclass to define later on?
Functionality common to all subclasses should
be placed in the superclass
20
RMIT Classification: Trusted
Review Question 7
• How do you refer to functionality defined in
the superclass from within the subclass?
21
RMIT Classification: Trusted
Review Question 8
A method defined in a superclass is redefined in a
subclass with an identical method signature. This is
called ___________.
• Method overloading
• Method overriding
22
RMIT Classification: Trusted
Review Question 9
• What does the term polymorphism refer to?
SAccount
Account reference
account1
CAccount
23
RMIT Classification: Trusted
Review Question 10
Will the program below result in error during
compilation?
class A {
public void method1() {}
}
class B extends A {}
Review Question 11
Which of the statements in the main method below will
result in error during compilation?
class A {
public void method1() {}
}
class B extends A {
public void method2() {}
}
public class Test {
public static void main(String args[]) {
B b = new B();
A a = b;
a.method1();
a.method2();
}
}
The statement resulting in error: a.method2();
Only methods of the superclass can be called through this reference. 25
RMIT Classification: Trusted
Review Question 12
What will be the output of the program below?
class A {
public void method1() {
System.out.print("A.method1");
}
}
class B extends A {
public void method1() {
System.out.print("B.method1");
}
}
public class Test {
public static void main(String args[]) {
B b = new B();
A a = b;
a.method1();
}
}
Recap
• Course introduction
• Review of OO programming concepts
• Questions?
27