How to Override A Method in Java -


i play robocode (it java programming game). want change method

public void onscannedrobot (scannedrobotevent e) {  } 

to

public int onscannedrobot(scannedrobotevent e){ } 

so can adapt robot more if scanned true or false.

i heard possible overriding method. tryed it:

i wrote:

public void onscannedrobot(scannedrobotevent e) {      public int onscannedrobot(scannedrobotevent e) {         return 1;     } } 

but won't work

this won't work because return type of overriden method should same or subtype of return type declared in original method. @ link overriding , overloading


Comments

  1. Hello Admin,

    A significant qualification in classes of help purchase does among deeded furthermore right-to-use understandings.

    Regards,
    Thanks

    RITU

    ReplyDelete
  2. In the dynamic world of digital marketing, where imagination meets analytics, businesses unlock limitless possibilities by crafting compelling stories, fostering brand resonance, and igniting a digital revolution that propels them towards unrivaled triumph.
    Digital marketing institute in Delhi

    ReplyDelete

Post a Comment

Popular posts from this blog

c++ - How to add Crypto++ library to Qt project -

jQuery Mobile app not scrolling in Firefox -

How to use vim as editor in Matlab GUI -