Orhan Tozan
05/19/2020, 11:39 PMaraqnid
05/20/2020, 1:01 AMexpect
factory function defined in common, and then an implementation of the interface and an actual
for the factory function defined in each platform.Erik Christensen
05/20/2020, 1:41 AM#ifdef
in C or C++ (or compiling different source files for each platform that implement functions defined in a common header file).
You could expect
an interface in common code, but then have the actual
interface be a Java Standard Library interface on JVM and something else on a native platform where that interface doesn't exist. You can't accomplish that with traditional interfaces and implementations.
There are situations where you could use the two approaches interchangeably, but that's not always the case.Orhan Tozan
05/20/2020, 2:27 AMgildor
05/20/2020, 4:11 AMaraqnid
05/20/2020, 4:15 AMrusshwolf
05/20/2020, 12:37 PMkpgalligan
05/20/2020, 1:47 PM()->Whatever
is just shorthand for an interface with one function.Orhan Tozan
05/20/2020, 1:51 PMkpgalligan
05/20/2020, 1:51 PMprintStackTrace
as an example (yes, I know that’ll be standard in 1.4)