Applications written for JDK1.0 used the existing Java API, but with JDK1.1 onwards, some methods have been marked as deprecated. The API has been restructured and modified, with new classes and methods that provide similar functionality. Whenever possible, you should modify your application to remove references to deprecated methods/classes, and use the new alternatives offered [...]
Home > Java
When I compile a Java application using the new JDK1.1 compiler from Sun, it says that it uses “a deprecated API”. What does this mean?
What is the difference between public, private, and protected keywords? Do I even need to use them?
We use these keywords to specify access levels for member variables, or for member functions (methods).
Public variables, are variables that are visible to all classes.
Private variables, are variables that are visible only to the class to which they belong.
Protected variables, are [...]
What does the keyword ’static’ mean?
The static keyword denotes that a member variable, or method, can be accessed without requiring an instantiation of the class to which it belongs.
In simple terms, it means that you can call a method, even if you’ve never created the object to which it belongs! Every time you run a stand-alone application (which requires a [...]
What exactly are Java Beans?
Java Beans are components that can be used to assemble a larger Java application. Beans are classes that have properties, and can trigger events.
To define a property, a bean author provides accessor methods, that can get and set the value of a property. A bean tool should inspect the class for methods matching the get/set [...]
How can I use a quote ” character within a string?
When we use literal strings in Java, we use the quote (”) character to indicate the beginning and ending of a string. For example, to declare a string called myString, we could this :-
String myString = “this is a string”;
But what if we wanted to include a quote (”) character WITHIN the string. We can [...]
How can I find out who is connected to my server?
If you write applications that supply TCP services via the StreamSocket class, its extremely easy to determine the IP address and port of the remote connection. The accept method returns a Socket (which is used to communicate with the remote client). The Socket class has a getInetAddress(), and a getPort() method - all instances of [...]
Where can I get general Java programming help?
While Apple currently does not offer any “Java beginner” content, there are plenty of areas dedicated to starting off with Java:
The Java Tutorial - A thorough introduction from Sun, the creators of Java
Java Discussion Forums - Mailing lists and online [...]
How do I find out which Java version my app is using?
Sometimes you may need this information to implement a specific feature or to implement a workaround to a bug that has been fixed in later releases. Technical Note TN2110 discusses how to best do this, along with a comprehensive list of version strings for every Java release on every version of Mac OS X.
Which Java version do Applets use?
Java Applets inside Safari can be configured to run any installed Java version by using the Java Preferences application.
How do I handle the items in the Mac OS X Application menu?
Responding to the application menu is discussed in the Making User Interface Decisions section of the Java Development Guide for Mac OS X. The OSXAdapter sample illustrates how to use them in a way that will still run correctly on other platforms.
