View Single Post
  #5   Spotlight this post!  
Unread 25-06-2016, 16:35
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 312
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: Method From ColorImage

Quote:
Originally Posted by Ouroboroz View Post
Wait would casting MonoImage into BinaryImage work too?
No, because you can only downcast an object if it was that type to begin with.

Code:
class A {}
class B extends A {}

public static void main(String[] args){
    A a1 = new B();
    B a1_b = (B) a1; // ok

    A a2 = new A();
    B a2_b = (B) a2; // ClassCastException
}
More info: https://docs.oracle.com/javase/tutor...ubclasses.html
__________________
Creator of SmartDashboard.js, an extensible nodejs/webkit replacement for SmartDashboard


https://ligerbots.org
Reply With Quote