Scrigroup - Documente si articole

     

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

AspAutocadCDot netExcelFox proHtmlJava
LinuxMathcadPhotoshopPhpSqlVisual studioWindowsXml

java



+ Font mai mare | - Font mai mic



Controlling cloneability: The copy-constructor

Controlling cloneability You might suggest that, to remove clonability, the clone( ) method simply be made private, but this won’t work since you cannot take a base-class method and make it more private in a derived class. So it’s not that
Citeste tot ... 1795 cuvinte
Dimensiune medie
- fara imagini
fisier mediu articol fara poze

protected: “sort of friendly”

protected: “sort of friendly” The protected access specifier requires a jump ahead to understand. First, you should be aware that you don’t need to understand this section to continue through the book up through the inheritance chapter. But for
Citeste tot ... 201 cuvinte
Dimensiune mica
- fara poza
fisier mic articol fara poze

Collections - Disadvantage: unknown type

Collections To summarize what we’ve seen so far, your first, most efficient choice to hold a group of objects should be an array, and you’re forced into this choice if you want to hold a group of primitives. In the remainder of the chapter we’l
Citeste tot ... 1228 cuvinte
Dimensiune mica
- fara poza
fisier mic articol fara poze

Sharing limited resources: Improperly accessing resources

Sharing limited resources You can think of a single-threaded program as one lonely entity moving around through your problem space and doing one thing at a time. Because there’s only one entity, you never have to think about the problem of two
Citeste tot ... 2548 cuvinte
Dimensiune medie
- fara imagini
fisier mediu articol fara poze

Unsupported operations

Unsupported operations It’s possible to turn an array into a List with the static Arrays.toList( ) method: //: Unsupported.java // Sometimes methods defined in the Collection // interfaces don't work! package c08.newcollectio
Citeste tot ... 591 cuvinte
Dimensiune mica
- fara poza
fisier mic articol fara poze

Java programming guidelines

Java programming guidelines This appendix contains suggestions to help guide you while performing low-level program design, and also while writing code. 1.       Capitalize the first letter of class names. The f
Citeste tot ... 1533 cuvinte
Dimensiune medie
- fara imagini
fisier mediu articol fara poze




The new AWT: The new event model

The new AWT In Java 1.1 a dramatic change has been accomplished in the creation of the new AWT. Most of this change revolves around the new event model used in Java 1.1: as bad, awkward, and non-object-oriented as the old event model was, the
Citeste tot ... 7526 cuvinte
Dimensiune mare
- fara imagini
fisier mare articol fara poze

Text fields

Text fields A TextField is a one line area that allows the user to enter and edit text. TextField is inherited from TextComponent, which lets you select text, get the selected text as a String, get or set the text, and set whether the TextField
Citeste tot ... 208 cuvinte
Dimensiune mica
- fara poza
fisier mic articol fara poze

Specifying initialization

Specifying initialization What happens if you want to give a variable an initial value? One direct way to do this is simply to assign the value at the point you define the variable in the class. (Notice you cannot do this in C++, although C++ n
Citeste tot ... 150 cuvinte
Dimensiune mica
- fara poza
fisier mic articol fara poze

RTTI syntax

RTTI syntax Java performs its RTTI using the Class object, even if you’re doing something like a cast. The class Class also has a number of other ways you can use RTTI. First, you must get a handle to the appropriate Class object. One way to
Citeste tot ... 547 cuvinte
Dimensiune mica
- fara poza
fisier mic articol fara poze

The twist - Method call binding


The twist The difficulty with Music.java can be seen by running the program. The output is Wind.play( ). This is clearly the desired output, but it doesn’t seem to make sense that it would work that way. Look at the tune( ) method:
Citeste tot ... 1219 cuvinte
Dimensiune mica
+ cu imagini
fisier mic articol cu poze

Class access

Class access In Java, the access specifiers can also be used to determine which classes within a library will be available to the users of that library. If you want a class to be available to a client programmer, you place the public keyword
Citeste tot ... 500 cuvinte
Dimensiune mica
- fara poza
fisier mic articol fara poze


Performance: Locating the bottleneck

Performance This appendix was contributed by and used with the permission of Joe Sharp, consultant (SharpJoe@aol.com). The Java language emphasizes accurate, reliable behavior at the expense of performance. This is reflected in features such
Citeste tot ... 2531 cuvinte
Dimensiune medie
- fara imagini
fisier mediu articol fara poze

The generic collection library


The generic collection library You’ve seen in this chapter that the standard Java library has some fairly useful collections, but far from a complete set. In addition, algorithms like sorting are not supported at all. One of the strengths of C+
Citeste tot ... 2170 cuvinte
Dimensiune medie
+ cu poze
fisier mediu articol cu poze

switch

switch The switch is sometimes classified as a selection statement. The switch statement selects from among pieces of code based on the value of an integral expression. Its form is: switch(integral-selector) Integral-selector is an expres
Citeste tot ... 379 cuvinte
Dimensiune mica
- fara poza
fisier mic articol fara poze

Connecting to databases with JDBC

Connecting to databases with JDBC It has been estimated that half of all software development involves client/server operations. A great promise of Java has been the ability to build platform-independent client/server database applications. In
Citeste tot ... 2418 cuvinte
Dimensiune medie
- fara imagini
fisier mediu articol fara poze

Simulating the trash recycler

Simulating the trash recycler The nature of this problem is that the trash is thrown unclassified into a single bin, so the specific type information is lost. But later, the specific type information must be recovered to properly sort the trash
Citeste tot ... 3357 cuvinte
Dimensiune medie
- fara imagini
fisier mediu articol fara poze

The this keyword

The this keyword If you have two objects of the same type called a and b, you might wonder how it is that you can call a method f( ) for both those objects: class Banana } Banana a = new Banana(), b = new Banana(); a.f(1); b
Citeste tot ... 344 cuvinte
Dimensiune mica
- fara poza
fisier mic articol fara poze

Overriding vs

Overriding vs. overloading Let’s take a different look at the first example in this chapter. In the following program, the interface of the method play( ) is changed in the process of overriding it, which means that you haven’t overridden
Citeste tot ... 274 cuvinte
Dimensiune mica
- fara poza
fisier mic articol fara poze

Constructors and polymorphism - Order of constructor calls

Constructors and polymorphism As usual, constructors are different from other kinds of methods. This is also true when polymorphism is involved. Even though constructors are not polymorphic (although you can have a kind of “virtual constructor
Citeste tot ... 1636 cuvinte
Dimensiune medie
- fara imagini
fisier mediu articol fara poze


Alte pagini

1 3 4 5 6 7 8 9 10


Politica de confidentialitate | Termeni si conditii de utilizare




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