Hugging Face
Models
Datasets
Spaces
Community
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
KaiquanMah
/
TurkuBasicOOPinJava
like
0
Running
App
Files
Files
Community
d58d581
TurkuBasicOOPinJava
/
Week 6: Methods of OO Programming
93.4 kB
1 contributor
History:
26 commits
KaiquanMah
Create 16. The Last Piece, Part 3: The Game Board
6bd73f4
verified
8 months ago
01A. Static members [= CLASS MEMBER, not object member]
5.13 kB
public static dtype method1(param1) {...}
8 months ago
01B. Class StringHelper
2.15 kB
public static int method1(dtype param1)
8 months ago
02. Class SecretAgent
4.39 kB
if (staticMethod2(param1)) {...}
8 months ago
03A. Class variables = STATIC VARIABLES
2.21 kB
public static dtype STATICVARIABLEINCAPS = <value>;
8 months ago
03B. Nordic countries as class variables
728 Bytes
public static String FINLAND = "FI";
8 months ago
04. Fish within permitted limits
2.41 kB
this.attribute1 >= Class2.PUBLICSTATICATTRIBUTE2
8 months ago
05A. Interfaces+++
4.87 kB
interface INTERFACE1 {dtype method1();}
8 months ago
05B. Write an interface class Calculator
1.31 kB
void add(int number); double getResult();
8 months ago
06. The Calculator implements an interface
3.6 kB
@Override public void add(int number) {this.result += number;}
8 months ago
07A. Interface 'Comparable' [compareTo method]+++
4.99 kB
int/double, str (alphabetical)
8 months ago
07B. Determine the Longest Route
3.47 kB
@Override public int compareTo(Route other)
8 months ago
08. Comparable Point
3.21 kB
condition compares using double, then return int
8 months ago
09 Polymorphism+++
7.31 kB
reusable method for SUPERCLASS n SUBCLASSES, ArrayList, SUPERCLASS METHOD
8 months ago
09B. Oldest Fairy Tale Character
4.36 kB
Create 09B. Oldest Fairy Tale Character
8 months ago
10A. Interface Class as Variable Type+++
2.46 kB
public static Priced mostExpensive(ArrayList<Priced> list) {...}
8 months ago
10B. How Many Can Fit in a Container?
3.46 kB
public static int howManyFit(Container largeContainer, Container smallContainer) {...}
8 months ago
11A. TYPE Conversions OR CASTING+++
2.01 kB
int approximation = (int) height;
8 months ago
11B. Calculate the Total Load of Trucks
2.49 kB
SubClass1 subClassVar1 = (SubClass1) superClassVar1;
8 months ago
12A. Dynamic Binding+++
6.07 kB
FIND LATEST IMPLEMENTED METHOD vs instanceof vs getClass [OBJECT TYPE]
8 months ago
12B. Count the Wizards [instanceof]
5.65 kB
if (obj1 instanceof Class1) { countClass1++; }
8 months ago
13. People on Ships
4.04 kB
people += ((PassengerShip) ship).getPassengers();
8 months ago
14A. Modifier 'final'+++
4.29 kB
final LocalVariable/ClassAttribute/MethodParam/Method/Class
8 months ago
14B. The Last Piece, Part 1: The Color Class
1.52 kB
public static final int VARIABLE = 2;
8 months ago
15. The Last Piece, Part 2: The GamePiece Class
1.41 kB
final class Class1 {...}
8 months ago
16. The Last Piece, Part 3: The Game Board
9.82 kB
Create 16. The Last Piece, Part 3: The Game Board
8 months ago