Scrigroup - Documente si articole

Username / Parola inexistente      

Home Documente Upload Resurse Alte limbi doc  


AccessAdobe photoshopAlgoritmiAutocadBaze de dateCC sharp
CalculatoareCorel drawDot netExcelFox proFrontpageHardware
HtmlInternetJavaLinuxMatlabMs dosPascal
PhpPower pointRetele calculatoareSqlTutorialsWebdesignWindows
WordXml

AspAutocadCDot netExcelFox proHtmlJava
LinuxMathcadPhotoshopPhpSqlVisual studioWindowsXml

Name hiding

java

+ Font mai mare | - Font mai mic



DOCUMENTE SIMILARE

Trimite pe Messenger
Date And Advanced Classes
Name hiding
Handling Text, Dialogs, And Lists
Using Java operators
Introduction to Seam
Network And Sockets
Handling URLs And Networking Exceptions
Exception matching
Casting operators
The Component Class


Name hiding

Only C++ programmers might be surprised by name hiding, since it works differently in that language. If a Java base class has a method name thatís overloaded several times, redefining that method name in the derived class will not hide any of the base-class versions. Thus overloading works regardless of whether the method was defined at this level or in a base class:




//: Hide.java

// Overloading a base-class method name

// in a derived class does not hide the

// base-class versions

class Homer

float doh(float f)

class Milhouse

class Bart extends Homer {

void doh(Milhouse m)

class Hide

As youíll see in the next chapter, itís far more common to override methods of the same name using exactly the same signature and return type as in the base class. It can be confusing otherwise (which is why C++ disallows it, to prevent you from making what is probably a mistake).






Politica de confidentialitate



DISTRIBUIE DOCUMENTUL

Comentarii


Vizualizari: 436
Importanta: rank

Comenteaza documentul:

Te rugam sa te autentifici sau sa iti faci cont pentru a putea comenta

Creaza cont nou

Termeni si conditii de utilizare | Contact
© SCRIGROUP 2021 . All rights reserved

Distribuie URL

Adauga cod HTML in site