August 3, 1999

What Final Does in Java

When you declare a class as final, it can no longer be subclassed. Java has used this for security purposes with classes like String and Integer. It also allows the compiler to make some optimizations. When you declare a method of a class as final, subclasses of the class cannot

Understanding Interfaces

An interface describes the public methods that a class should implement along with the calling conventions of those methods. An Interface says nothing about implementation of its methods. In essence, an interface is a contract of guaranteed operations, or behaviors. A class that implements an interface must provide code to

What ‘abstract’ does

When you declare a class as abstract, it cannot be instantiated. Only subclasses of an abstract class can be instantiated if they are not abstract themselves. When you declare a method as abstract, that method is not implemented in the current class, i.e. it has no body

What ‘synchronized’ does to a method

When you synchronize a method of a class, as in: public synchronized int getAge(){ …} that method will acquire a monitor lock before execution. If the synchronized method is static, e.g. a class method, the lock is obtained over the class. Otherwise, the lock is obtained over an instance object

What ‘static’ Does

When you declare a field variable of a class as static, that field variable is instantiated only once, no matter how many instances of the class are created. In other words, a static field variable is a class variable, and, not an instance variable. If the value of a static

Persistence and Serialization

Question: What is the best source, print or online, for learning how to implement persistence in C++? I want to save my objects to disk and restore them, and I want to learn how to do this from scratch, not by purchasing someone’s library. Answer: I don’t know which compiler

SQL Server 6.5: Sometimes There, Sometimes Not

Question: I am using SQL Server 6.5 for my database needs and Visual C++ as a front-end. The problem is that sometimes when I switch on the server (where the SQL Server is also running) and try to access the database, I cannot see any database items in the drop-down

Using ADO-Connected Recordsets with MTS

Question: Can I use ADO-connected recordsets with MTS? From the information I can find it seems that MTS does not handle them. Answer: You can, but the question is, do you really want to? Using a connected (rather than disconnected) recordset means that you must maintain a stateful connection to

Blinking Borders in Spy++

Question: How does Spy++ make the borders of a window blink when you select “Highlight” from the right-click menu? I have a MouseProc in the hook chain, so I can get the handle of the window that the mouse is over; I just need to know how to make the

No more posts to show