Computer Store
-Collapse +Expand
Search Java Group:

-Collapse +Expand Java To/From
-Collapse +Expand Java Store

Prestwood eMagazine

April Edition
Subscribe now! It's Free!
Enter your email:

   ► KB ►► ProgrammingJava   Print This    All Groups  

Java Latest KB Comments

Ordered newest to oldest.

To view comments to your KB Articles, go to your My Knowledge Base page. To view user contributions to your blogs, go to your My Blog page.

Read +Add Comment
The logical operators '&' and '~' (bitwise 'and' and 'not') can be useful in rounding numbers. Suppose I have a variable x and I want to round it up to a multiple of 4. This code will do that.     x = (x + 3) & ~3; Rounding down to a multiple of 4 is even easier.     x = x & ~3; This only works for rounding to a power of 2, however, that is a common requirement and this code is much more efficient for rounding to a power of 2 than using the modulo operator and division.
Posted 11 years ago
Java Logical Operators
{Too Long!}
Read +Add Comment
{Too Long!}
Posted 16 years ago
Implementing the Composite and Visitor Patterns in Java
Implementing design patterns can be difficult and little sample code exists that walks you through the process. The purpose of this article is to walk through the implementation of a program that uses the Composite and Visitor design patterns. The sample project is written in the object-oriented language, Java, but it could just as easily have been written in C++.

©1995-2020 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech