Java

Identifier – naming conventions

Variables – local vs class variable, instance vs static variable

Data Type – primitive vs reference data type

Type Conversion – implicit vs explicit type conversion, int <-> String conversion, numeric data type conversion

Operator – arithmetic vs relational vs bitwise vs logical vs assignment operator, operator precedence, postfix vs prefix increment/decrement operator

Control Statement – if/else, switch, for/foreach, while/do-while, break/continue

Array – primitive vs object array, 2D array, returning an array vs passing an array as parameter

Enum – enum data type, enum Operation example, enum Operator, enum Gender

Method – parameter passing (pass-by value – primitive vs reference data type), swap, method overloading vs overriding

OOP(Encapsulation, Inheritance, Polymorphism)

Class – default/public/protected/private, instance vs static member, constructor usage guideline, singleton design pattern vs static class,

Inheritance – BankAccount SavingAccount CheckingAccount class(instance vs static member), Car Sedan class (default/public/protected/private), Person Student class (instance vs static method overriding)

Polymorphism – Polymorphism vs Method Overriding vs Method OverloadingAbstract Class & Polymorphism

Interface – Comparable & Comparator Interface, Shape Polymorphism with Interface

Swing – Swing Component, Layout Manager, 5 Ways to Implement Event Listener, Event Listener (ChangeListener, KeyListener, ActionListener), TemperatureConverter, MetricConverter, AridityIndex, BMICalculator, Key Mouse Motion Listener & Adapter, Custom Component, TripleCalculatorFrame

Collections – autoboxing and unboxingArray vs ArrayList,
Difference between Array and ArrayList,
Equals vs Contains== vs equals vs hashCode

 

 

기말고사

일시: 2018년 6월 12일(화) 밤 8:00

장소: 2공 105호

시험범위: 중간고사 포함 – 배운데까지 (OOP, Polymorphism, Collection, SWING)

 

Lab7 find


// find photo by fullPath and highlight it
public void find() {
	System.out.println("Find image");
	String[] options = photoManager.getPhotoFullPaths(); // get photoList's fullPaths (as String[])
	if (options == null) return; // if photoManager has no photo, then return here
	String fullPath = (String)JOptionPane.showInputDialog(null, "Find the image:", "Find", JOptionPane.QUESTION_MESSAGE, null, options, options[0]);
	if (fullPath != null) {
		Photo found = photoManager.find(fullPath); // find photo by fullPath
		if (found == null) return; // if photo is not found, then return here
		found.print();
		// find ImageLabel component that has the same fullPath. If found, then highlight its border to red
		Component[] componentList = photoPanel.getComponents();
		for (Component c: componentList) {
			if (c instanceof ImageLabel) 
				((JLabel)c).setBorder(javax.swing.BorderFactory.createEmptyBorder());
		}
		for(Component c : componentList) {
			if (c instanceof ImageLabel) {
				if (((ImageLabel)c).getFullPath() == fullPath) { // find ImageLabel component that has the same fullPath
					Border border = BorderFactory.createLineBorder(Color.RED, 3); // highlight its border to red
					((JLabel)c).setBorder(border);
				}
			}
		}
	}
}