Describing What Your Object Is Like
Describing What Your Object Is Like As you learned during last hour's introduction to object-oriented programming, an object is a way of organizing a program so that it has everything it needs to accomplish a task. Objects need two things to doCiteste tot ... 2491 cuvinte
Dimensiune medie - fara imagini |
|
|
Working with Graphics in JAVA
Working with Graphics During the previous hour you had a chance to experience the joy of text by displaying strings in a variety of fonts and colors. Using these Java classes makes the programming language an enjoyable text aid, but at some poCiteste tot ... 2290 cuvinte
Dimensiune medie - fara imagini |
|
|
Playing Games with Java
Playing Games with Java At this point, you have more than enough Java programming skills to be a danger to yourself and others. You can write programs for the World Wide Web and programs to run locally on your computer. The next several hoursCiteste tot ... 3175 cuvinte
Dimensiune medie - fara imagini |
|
|
Making Your Knowledge Add Up
Making Your Knowledge Add Up Most of the programs you created during the first 20 hours of this book were short tutorials intended to demonstrate a specific aspect of Java programming. These types of programs can be useful when you're introduceCiteste tot ... 2305 cuvinte
Dimensiune medie - fara imagini |
|
|
Writing Your First Program in Java
Writing Your First Program As you learned during Hour 1, 'Becoming a Programmer,' a computer program is a set of instructions that tell a computer what to do. These instructions are prepared in the same way instructions could be giveCiteste tot ... 3805 cuvinte
Dimensiune medie - fara imagini |
|
|
Understanding How Java Programs Work
Understanding How Java Programs Work An important distinction to make in Java programming is where your program is supposed to be running. Some programs are intended to work on your computer; you type in a command or click on an icon to start tCiteste tot ... 2310 cuvinte
Dimensiune medie - fara imagini |
|
|
Performing cleanup with finally: What’s finally for?
Performing cleanup with finally There’s often some piece of code that you want to execute whether or not an exception occurs in a try block. This usually pertains to some operation other than memory recovery (since that’s taken care of by thCiteste tot ... 786 cuvinte
Dimensiune mica - fara poza |
|
|
CORBA - CORBA Fundamentals
CORBA In large, distributed applications, your needs might not be satisfied by the preceding approaches. For example, you might want to interface with legacy datastores, or you might need services from a server object regardless of its physicalCiteste tot ... 2313 cuvinte
Dimensiune medie - fara imagini |
|
|
Iteration
Iteration while, do-while and for control looping and are sometimes classified as iteration statements. A statement repeats until the controlling Boolean-expression evaluates to false. The form for a while loop is while(Boolean-expression)Citeste tot ... 117 cuvinte
Dimensiune mica - fara poza |
|
|
Check boxes
Check boxes A check box provides a way to make a single on-off choice; it consists of a tiny box and a label. The box typically holds a little ‘x’ (or some other indication that it is set) or is empty depending on whether that item was selectedCiteste tot ... 196 cuvinte
Dimensiune mica - fara poza |
|
|
The infamous “goto”
The infamous “goto” The goto keyword has been present in programming languages from the beginning. Indeed, goto was the genesis of program control in assembly language: “if condition A, then jump here, otherwise jump there.” If you read the assCiteste tot ... 859 cuvinte
Dimensiune mica - fara poza |
|
|
The File class: A directory lister
The File class The File class has a deceiving name – you might think it refers to a file, but it doesn’t. It can represent either the name of a particular file or the names of a set of files in a directory. If it’s a set of files, you can ask foCiteste tot ... 1277 cuvinte
Dimensiune mica - fara poza |
|
|
Choosing an implementation: Choosing between Lists, Sets
Choosing an implementation From the diagram on page 363 you can see that there are really only three collection components: Map, List, and Set, and only two or three implementations of each interface. If you need to use the functionality offeredCiteste tot ... 1875 cuvinte
Dimensiune medie - fara imagini |
|
|
Overloading with primitives
Overloading with primitives Primitives can be automatically promoted from a smaller type to a larger one and this can be slightly confusing in combination with overloading. The following example demonstrates what happens when a primitive is hanCiteste tot ... 412 cuvinte
Dimensiune mica - fara poza |
|
|
Basic exceptions
Basic exceptions An exceptional condition is a problem that prevents the continuation of the method or scope that you’re in. It’s important to distinguish an exceptional condition from a normal problem, in which you have enough information in tCiteste tot ... 656 cuvinte
Dimensiune mica - fara poza |
|
|
Using imports to change behavior
Using imports to change behavior A feature that is missing from Java is C’s conditional compilation, which allows you to change a switch and get different behavior without changing any other code. The reason such a feature was left out of JavaCiteste tot ... 475 cuvinte
Dimensiune mica - fara poza |
|
|
Text areas
Text areas A TextArea is like a TextField except that it can have multiple lines and has significantly more functionality. In addition to what you can do with a TextField, you can append text and insert or replace text at a given location. It sCiteste tot ... 234 cuvinte
Dimensiune mica - fara poza |
|
|
Radio buttons
Radio buttons The concept of a radio button in GUI programming comes from pre-electronic car radios with mechanical buttons: when you push one in, any other button that was pressed pops out. Thus it allows you to force a single choice among manCiteste tot ... 261 cuvinte
Dimensiune mica - fara poza |
|
|
Types of collections: Vector, BitSet, Stack
Types of collections The standard Java 1.0 and 1.1 library comes with a bare minimum set of collection classes, but they’re probably enough to get by with for many of your programming projects. (As you’ll see at the end of this chapter, Java 1.Citeste tot ... 2973 cuvinte
Dimensiune medie - fara imagini |
|
|
Abstract classes and methods
Abstract classes and methods In all the instrument examples, the methods in the base class Instrument were always “dummy” methods. If these methods are ever called, you’ve done something wrong. That’s because the intent of Instrument is to cCiteste tot ... 627 cuvinte
Dimensiune mica + cu imagini |
|
|
Alte pagini