TS 68 JavaFX Hints

(Difference between revisions)
(Created page with ''''Author:''' <br> '''Version:''' 1.1 <br> '''Last update:''' 23 November 2009 <br> '''Introduction:''' <br> '''Comments:''' <br> __TOC__ == Implement all abstract methods …')
(Implement all abstract methods)
Line 10: Line 10:
== Implement all abstract methods ==
== Implement all abstract methods ==
      
      
 +
=== {{testcase|Argument with Sequence type }} ===
 +
*  Copy the code to the editor:
 +
<code> <pre>       
 +
abstract class A{
 +
    abstract function f (seq:Boolean[]);
 +
}
 +
 +
class B extends A{
 +
 +
}
 +
</pre> </code> 
 +
*  Implement all abstract methods .
 +
** {{result|EXPECTED RESULT:  Implementation of the abstract methods should be added  }}
 +
<code> <pre> 
 +
import java.lang.UnsupportedOperationException;
 +
 +
abstract class A{
 +
    abstract function f (seq:Boolean[]);
 +
}
 +
 +
class B extends A{
 +
    override function f (seq : Boolean[]) : Object {
 +
        throw new UnsupportedOperationException('Not implemented yet');
 +
    }
 +
}
 +
</pre> </code>
 +
 +
=== {{testcase|Generic interface}} ===
=== {{testcase|Generic interface}} ===
*  Copy the code to the editor:
*  Copy the code to the editor:

Revision as of 11:03, 23 November 2009

Author:
Version: 1.1
Last update: 23 November 2009
Introduction:
Comments:


Contents


Implement all abstract methods

Argument with Sequence type

  • Copy the code to the editor:
         
abstract class A{
    abstract function f (seq:Boolean[]);
}

class B extends A{

}
  • Implement all abstract methods .
    • EXPECTED RESULT: Implementation of the abstract methods should be added
  
import java.lang.UnsupportedOperationException;

abstract class A{
    abstract function f (seq:Boolean[]);
}

class B extends A{
    override function f (seq : Boolean[]) : Object { 
        throw new UnsupportedOperationException('Not implemented yet');
    }
}


Generic interface

  • Copy the code to the editor:
         
import java.lang.Comparable;

class Vector extends Comparable {
}
  • Implement all abstract methods .
    • EXPECTED RESULT: Implementation of the abstract methods should be added
import java.lang.Comparable;
import java.lang.UnsupportedOperationException;

class Vector extends Comparable {
    override public function compareTo (arg) : Integer {
        throw new UnsupportedOperationException('Not implemented yet');
    }
}
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo