Java Programing laungage

Core Java Tutorial

Introduction of Core Java

How To Install JDk and Set of Path

Syntax of java Program

Difference between Java and C/C++

Advantage and Disadvantage of Java

What is Java

Why Java is not Pure Object Oriented Language

Java has Following Features/Characteristics

Limitation of Java Language and Java Internet

Common Misconception about Java

Simple Program of Java

Integrated Development Environment in java

Compile and Run Java Program

Applet and Comments in Java

Tokens in Java

Keywords in Java

Identifier and Variables in Java

Literals/Constants

Data Type in Java

Assignments and Initialization in Java

Operators in Java

Rule of Precedence in Java

Operator on Integer and Separators in Java Programming

Java Control Flow of Statements

If and If-else Selection Statement

Nested If-else and If-else-If Selection Statement

switch case and conditional operator Selection Statement

for and while Loop

do..while and for each Loop

break and labeled break statement

continue and labeled continue statement

return Statement and exit() Method

Escape Sequence for Special Characters and Unicode Code

Constants and Block or Scope

Statement in Java

Conversions between Numeric Types in Java

Import Statement in Java

User Input in Java using Scanner Class

User Input in Java using Console Class

Array in Java

One Dimensional Array

Two Dimensional Array

Two Dimensional Array Program

Command Line Argument in Java

String args Types in Java

Uneven/Jagged array in java

Math Class Function and Constant

Math Class all Function used in a program

Enumerated Types in Java

Object Oriented Programming v/s Procedural Programming

Object Oriented Programming Concepts in Java

Introduction to Class,Object and Method in Java

Class Declaration in Java

Class & Objects in java

Encapsulation in Java

Modifiers/Visibility for a Class or Interrface or member of a Class

Polymorphism in Java

Runtime polymorphism (dynamic binding or method overriding)

Deprecated Methods in jdk 1.5
Previous Home Next
java.awt.Component.action(Event, Object) :

As of JDK version 1.1, should register this component as ActionListener on component which fires action events. :

java.awt.List.addItem(String) replaced by add(String)

java.awt.List.addItem(String, int) :

replaced by add(String, int)

java.awt.CardLayout.addLayoutComponent(String, Component) :

replaced by addLayoutComponent(Component, Object)

java.awt.BorderLayout.addLayoutComponent(String, Component) :

replaced by addLayoutComponent(Component, Object)

java.awt.List.allowsMultipleSelections() :

As of JDK version 1.1, replaced by isMultipleMode()

java.lang.ThreadGroup.allowThreadSuspension(boolean) :

The definition of this call depends on ThreadGroup.suspend(), which is deprecated. Further, the behavior of this call was never specified

java.awt.TextArea.appendText(String) :

As of JDK version 1.1, replaced by append(String)

java.awt.Window.applyResourceBundle(ResourceBundle) :

As of J2SE 1.4, replaced by Component.applyComponentOrientation

java.awt.Window.applyResourceBundle(String) :

As of J2SE 1.4, replaced by Component.applyComponentOrientation

java.awt.Component.bounds() :

As of JDK version 1.1, replaced by getBounds()

java.lang.SecurityManager.checkMulticast(InetAddress, byte) :

Use #checkPermission(java.security.Permission) instead :

java.lang.SecurityManager.classDepth(String) :

This type of security checking is not recommended. It is recommended that the checkPermission call be used instead

java.lang.SecurityManager.classLoaderDepth() :

This type of security checking is not recommended. It is recommended that the checkPermission call be used instead

java.awt.List.clear() :

As of JDK version 1.1, replaced by removeAll()

java.awt.image.renderable.RenderContext.concetenateTransform(AffineTransform) :

replaced by concatenateTransform(AffineTransform)

java.awt.Container.countComponents() :

As of JDK version 1.1, replaced by getComponentCount()

java.awt.Choice.countItems() :

As of JDK version 1.1, replaced by getItemCount()

java.awt.List.countItems() :

As of JDK version 1.1, replaced by getItemCount()

java.awt.Menu.countItems() :

As of JDK version 1.1, replaced by getItemCount()

java.awt.MenuBar.countMenus() :

As of JDK version 1.1, replaced by getMenuCount()

java.lang.Thread.countStackFrames() :

The definition of this call depends on Thread.suspend(), which is deprecated. Further, the results of this call were never well-defined

org.omg.CORBA.ORB.create_basic_dyn_any(TypeCode) :

Use the new DynAnyFactory API instead :

org.omg.CORBA.ORB.create_dyn_any(Any) :

Use the new DynAnyFactory API instead :

org.omg.CORBA.ORB.create_dyn_array(TypeCode) :

Use the new DynAnyFactory API instead :

org.omg.CORBA.ORB.create_dyn_enum(TypeCode) :

Use the new DynAnyFactory API instead :

org.omg.CORBA.ORB.create_dyn_sequence(TypeCode) :

Use the new DynAnyFactory API instead :

org.omg.CORBA.ORB.create_dyn_struct(TypeCode) :

Use the new DynAnyFactory API instead :

org.omg.CORBA.ORB.create_dyn_union(TypeCode) :

Use the new DynAnyFactory API instead :

org.omg.CORBA.ORB.create_recursive_sequence_tc(int, int) :

Use a combination of create_recursive_tc and create_sequence_tc instead :

javax.swing.plaf.basic.BasicSplitPaneUI.createKeyboardDownRightListener() :

As of Java 2 platform v1.3

javax.swing.plaf.basic.BasicSplitPaneUI.createKeyboardEndListener() :

As of Java 2 platform v1.3

javax.swing.plaf.basic.BasicSplitPaneUI.createKeyboardHomeListener() :

As of Java 2 platform v1.3

javax.swing.plaf.basic.BasicSplitPaneUI.createKeyboardResizeToggleListener() :

As of Java 2 platform v1.3

javax.swing.plaf.basic.BasicSplitPaneUI.createKeyboardUpLeftListener() :

As of Java 2 platform v1.3

javax.swing.JTable.createScrollPaneForTable(JTable) :

As of Swing version 1.0.2, replaced by new JScrollPane(aTable)

javax.swing.text.TableView.createTableCell(Element) :

Table cells can now be any arbitrary View implementation and should be produced by the ViewFactory rather than the table

java.lang.SecurityManager.currentClassLoader() :

This type of security checking is not recommended. It is recommended that the checkPermission call be used instead

java.lang.SecurityManager.currentLoadedClass() :

This type of security checking is not recommended. It is recommended that the checkPermission call be used instead

java.net.URLDecoder.decode(String) :

The resulting string may vary depending on the platform's default encoding. Instead, use the decode(String,String) method to specify the encoding

java.lang.ClassLoader.defineClass(byte[], int, int) :

Replaced by defineClass(String, byte[], int, int) :

java.awt.List.delItem(int) :

replaced by remove(String) and remove(int)

java.awt.List.delItems(int, int) :

As of JDK version 1.1, Not for public use in the future. This method is expected to be retained only as a package private method

java.awt.Component.deliverEvent(Event) :

As of JDK version 1.1, replaced by dispatchEvent(AWTEvent e)

java.awt.Container.deliverEvent(Event) :

As of JDK version 1.1, replaced by dispatchEvent(AWTEvent e) :

javax.management.MBeanServer.deserialize(ObjectName, byte[]) :

Use getClassLoaderFor to obtain the appropriate class loader for deserialization. :

javax.management.MBeanServer.deserialize(String, byte[]) :

Use MBeanServer.getClassLoaderRepository() to obtain the class loader repository and use it to deserialize

javax.management.MBeanServer.deserialize(String, ObjectName, byte[]) :

Use getClassLoader to obtain the class loader for deserialization

java.lang.Thread.destroy() :

This method was originally designed to destroy this thread without any cleanup. Any monitors it held would have remained locked. However, the method was never implemented. If were to be implemented, it would be deadlock-prone in much the manner of Thread.suspend().

If the target thread held a lock protecting a critical system resource when it was destroyed, no thread could ever access this resource again. If another thread ever attempted to lock this resource, deadlock would result. Such deadlocks typically manifest themselves as "frozen" processes.

For more information, see Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?

java.awt.MenuItem.disable() :

As of JDK version 1.1, replaced by setEnabled(boolean)

java.awt.Component.disable() :

As of JDK version 1.1, replaced by setEnabled(boolean)

javax.swing.JComponent.disable() :

As of JDK version 1.1, replaced by java.awt.Component.setEnabled(boolean)

javax.swing.table.TableColumn.disableResizedPosting() :

as of Java 2 platform v1.3 :

javax.swing.FocusManager.disableSwingFocusManager() :

as of 1.4, replaced by KeyboardFocusManager.setDefaultFocusTraversalPolicy(FocusTraversalPolicy) :

java.rmi.server.Skeleton.dispatch(Remote, RemoteCall, int, long) :

no replacement

java.rmi.server.RemoteCall.done() :

no replacement

java.rmi.server.RemoteRef.done(RemoteCall) :

1.2 style stubs no longer use this method. Instead of using a sequence of method calls to the remote reference (newCall, invoke, and done), a stub uses a single method, invoke(Remote, Method, Object[], int), on the remote reference to carry out parameter marshalling, remote method executing and unmarshalling of the return value

javax.swing.plaf.metal.MetalComboBoxUI.editablePropertyChanged(PropertyChangeEvent) :

As of Java 2 platform v1.4

java.awt.MenuItem.enable() :

As of JDK version 1.1, replaced by setEnabled(boolean)

java.awt.Component.enable() :

As of JDK version 1.1, replaced by setEnabled(boolean)

javax.swing.JComponent.enable() :

As of JDK version 1.1, replaced by java.awt.Component.setEnabled(boolean)

java.awt.MenuItem.enable(boolean) :

As of JDK version 1.1, replaced by setEnabled(boolean)

java.awt.Component.enable(boolean) :

As of JDK version 1.1, replaced by setEnabled(boolean)

javax.swing.table.TableColumn.enableResizedPosting() :

as of Java 2 platform v1.3 :

java.net.URLEncoder.encode(String) :

The resulting string may vary depending on the platform's default encoding. Instead, use the encode(String,String) method to specify the encoding

java.security.SignatureSpi.engineGetParameter(String) :

java.security.SignatureSpi.engineSetParameter(String, Object) :

Replaced by engineSetParameter

java.awt.datatransfer.DataFlavor.equals(String) :

As inconsistent with hashCode() contract, use isMimeTypeEqual(String) instead. :

org.omg.CORBA.ServerRequest.except(Any) :

use set_exception() :

java.rmi.server.RemoteCall.executeCall() :

no replacement

org.omg.CORBA.Any.extract_Principal() :

Deprecated by CORBA 2.2

javax.swing.SwingUtilities.findFocusOwner(Component) :

As of 1.4, replaced by KeyboardFocusManager.getFocusOwner()

org.omg.CORBA.ORB.get_current() :

use resolve_initial_references

java.security.Security.getAlgorithmProperty(String, String) :

This method used to return the value of a proprietary property in the master file of the "SUN" Cryptographic Service Provider in order to determine how to parse algorithm-specific parameters. Use the new provider-based and algorithm-independent AlgorithmParameters and KeyFactory engine classes (introduced in the Java 2 platform) instead

java.sql.CallableStatement.getBigDecimal(int, int) :

use getBigDecimal(int parameterIndex) or getBigDecimal(String parameterName) :

java.sql.ResultSet.getBigDecimal(int, int) :

java.sql.ResultSet.getBigDecimal(String, int) :

java.awt.Polygon.getBoundingBox() :

As of JDK version 1.1, replaced by getBounds()

java.lang.String.getBytes(int, int, byte[], int) :

This method does not properly convert characters into bytes. As of JDK 1.1, the preferred way to do this is via the getBytes() method, which uses the platform's default charset

java.awt.Graphics.getClipRect() :

As of JDK version 1.1, replaced by getClipBounds()

javax.swing.JPopupMenu.getComponentAtIndex(int) :

replaced by getComponent(int i) :

javax.swing.JMenuBar.getComponentAtIndex(int) :

replaced by getComponent(int i) :

java.awt.CheckboxGroup.getCurrent() :

As of JDK version 1.1, replaced by getSelectedCheckbox()

java.awt.Frame.getCursorType() :

As of JDK version 1.1, replaced by Component.getCursor()

java.sql.Time.getDate() :

java.util.Date.getDate() :

As of JDK version 1.1, replaced by Calendar.get(Calendar.DAY_OF_MONTH)

java.sql.Time.getDay() :

java.util.Date.getDay() :

As of JDK version 1.1, replaced by Calendar.get(Calendar.DAY_OF_WEEK)

java.net.URLConnection.getDefaultRequestProperty(String) :

The instance specific getRequestProperty method should be used after an appropriate instance of URLConnection is obtained

java.rmi.server.LogStream.getDefaultStream() :

no replacement

javax.management.monitor.StringMonitorMBean.getDerivedGauge() :

As of JMX 1.2, replaced by StringMonitorMBean.getDerivedGauge(ObjectName) :

javax.management.monitor.StringMonitor.getDerivedGauge() :

As of JMX 1.2, replaced by StringMonitor.getDerivedGauge(ObjectName) :

javax.management.monitor.CounterMonitorMBean.getDerivedGauge() :

As of JMX 1.2, replaced by CounterMonitorMBean.getDerivedGauge(ObjectName) :

javax.management.monitor.CounterMonitor.getDerivedGauge() :

As of JMX 1.2, replaced by CounterMonitor.getDerivedGauge(ObjectName) :

javax.management.monitor.GaugeMonitorMBean.getDerivedGauge() :

As of JMX 1.2, replaced by GaugeMonitorMBean.getDerivedGauge(ObjectName) :

javax.management.monitor.GaugeMonitor.getDerivedGauge() :

As of JMX 1.2, replaced by GaugeMonitor.getDerivedGauge(ObjectName) :

javax.management.monitor.StringMonitorMBean.getDerivedGaugeTimeStamp() :

As of JMX 1.2, replaced by StringMonitorMBean.getDerivedGaugeTimeStamp(ObjectName) :

javax.management.monitor.StringMonitor.getDerivedGaugeTimeStamp() :

As of JMX 1.2, replaced by StringMonitor.getDerivedGaugeTimeStamp(ObjectName) :

javax.management.monitor.CounterMonitorMBean.getDerivedGaugeTimeStamp() :

As of JMX 1.2, replaced by CounterMonitorMBean.getDerivedGaugeTimeStamp(ObjectName) :

javax.management.monitor.CounterMonitor.getDerivedGaugeTimeStamp() :

As of JMX 1.2, replaced by CounterMonitor.getDerivedGaugeTimeStamp(ObjectName) :

javax.management.monitor.GaugeMonitorMBean.getDerivedGaugeTimeStamp() :

As of JMX 1.2, replaced by GaugeMonitorMBean.getDerivedGaugeTimeStamp(ObjectName) :

javax.management.monitor.GaugeMonitor.getDerivedGaugeTimeStamp() :

As of JMX 1.2, replaced by GaugeMonitor.getDerivedGaugeTimeStamp(ObjectName) :

javax.swing.plaf.basic.BasicSplitPaneUI.getDividerBorderSize() :

As of Java 2 platform v1.3, instead set the border on the divider

java.awt.Toolkit.getFontList() :

see GraphicsEnvironment.getAvailableFontFamilyNames() :

javax.swing.text.LabelView.getFontMetrics() :

FontMetrics are not used for glyph rendering when running in the JDK

java.awt.Toolkit.getFontMetrics(Font) :

As of JDK version 1.2, replaced by the Font method getLineMetrics

java.awt.Toolkit.getFontPeer(String, int) :

see java.awt.GraphicsEnvironment#getAllFonts :

java.sql.Date.getHours() :

java.util.Date.getHours() :

As of JDK version 1.1, replaced by Calendar.get(Calendar.HOUR_OF_DAY)

java.lang.SecurityManager.getInCheck() :

This type of security checking is not recommended. It is recommended that the checkPermission call be used instead

java.rmi.server.RemoteCall.getInputStream() :

no replacement

javax.swing.KeyStroke.getKeyStroke(char, boolean) :

use getKeyStroke(char) :

javax.swing.AbstractButton.getLabel() :

Replaced by getText :

java.awt.Scrollbar.getLineIncrement() :

As of JDK version 1.1, replaced by getUnitIncrement()

java.lang.Runtime.getLocalizedInputStream(InputStream) :

As of JDK 1.1, the preferred way to translate a byte stream in the local encoding into a character stream in Unicode is via the InputStreamReader and BufferedReader classes

java.lang.Runtime.getLocalizedOutputStream(OutputStream) :

As of JDK 1.1, the preferred way to translate a Unicode character stream into a byte stream in the local encoding is via the OutputStreamWriter, BufferedWriter, and PrintWriter classes

java.sql.DriverManager.getLogStream() :

java.awt.FontMetrics.getMaxDecent() :

As of JDK version 1.1.1, replaced by getMaxDescent()

javax.swing.JInternalFrame.getMenuBar() :

As of Swing version 1.0.3, replaced by getJMenuBar()

javax.swing.JRootPane.getMenuBar() :

As of Swing version 1.0.3 replaced by getJMenubar()

java.sql.Date.getMinutes() :

java.util.Date.getMinutes() :

As of JDK version 1.1, replaced by Calendar.get(Calendar.MINUTE)

java.sql.Time.getMonth() :

java.util.Date.getMonth() :

As of JDK version 1.1, replaced by Calendar.get(Calendar.MONTH)

javax.swing.JComponent.getNextFocusableComponent() :

As of 1.4, replaced by FocusTraversalPolicy

javax.management.monitor.MonitorMBean.getObservedObject() :

As of JMX 1.2, replaced by MonitorMBean.getObservedObjects() :

javax.management.monitor.Monitor.getObservedObject() :

As of JMX 1.2, replaced by Monitor.getObservedObjects() :

java.rmi.server.Operation.getOperation() :

no replacement

java.rmi.server.Skeleton.getOperations() :

no replacement

java.awt.ComponentOrientation.getOrientation(ResourceBundle) :

As of J2SE 1.4, use ComponentOrientation.getOrientation(java.util.Locale)

java.rmi.server.LogStream.getOutputStream() :

no replacement

java.rmi.server.RemoteCall.getOutputStream() :

no replacement

java.awt.Scrollbar.getPageIncrement() :

As of JDK version 1.1, replaced by getBlockIncrement()

java.security.Signature.getParameter(String) :

java.awt.MenuComponent.getPeer() :

As of JDK version 1.1, programs should not directly manipulate peers

java.awt.Font.getPeer() :

Font rendering is now platform independent

java.awt.Component.getPeer() :

As of JDK version 1.1, programs should not directly manipulate peers; replaced by boolean isDisplayable()

java.rmi.server.RemoteCall.getResultStream(boolean) :

no replacement

java.sql.Date.getSeconds() :

java.util.Date.getSeconds() :

As of JDK version 1.1, replaced by Calendar.get(Calendar.SECOND)

java.rmi.server.LoaderHandler.getSecurityContext(ClassLoader) :

no replacement

java.rmi.server.RMIClassLoader.getSecurityContext(ClassLoader) :

no replacement. As of the Java 2 platform v1.2, RMI no longer uses this method to obtain a class loader's security context

javax.swing.JPasswordField.getText() :

As of Java 2 platform v1.2, replaced by getPassword

javax.swing.JPasswordField.getText(int, int) :

As of Java 2 platform v1.2, replaced by getPassword

javax.management.monitor.CounterMonitorMBean.getThreshold() :

As of JMX 1.2, replaced by CounterMonitorMBean.getThreshold(ObjectName) :

javax.management.monitor.CounterMonitor.getThreshold() :

As of JMX 1.2, replaced by CounterMonitor.getThreshold(ObjectName) :

java.util.Date.getTimezoneOffset() :

As of JDK version 1.1, replaced by -(Calendar.get(Calendar.ZONE_OFFSET) + Calendar.get(Calendar.DST_OFFSET)) / (60 * 1000)

java.net.MulticastSocket.getTTL() :

use the getTimeToLive method instead, which returns an int instead of a byte. :

java.net.DatagramSocketImpl.getTTL() :

use getTimeToLive instead

java.sql.ResultSet.getUnicodeStream(int) :

use getCharacterStream in place of getUnicodeStream :

java.sql.ResultSet.getUnicodeStream(String) :

use getCharacterStream instead :

javax.swing.ScrollPaneLayout.getViewportBorderBounds(JScrollPane) :

As of JDK version Swing1.1 replaced by JScrollPane.getViewportBorderBounds(). :

java.awt.Scrollbar.getVisible() :

As of JDK version 1.1, replaced by getVisibleAmount()

java.sql.Time.getYear() :

java.util.Date.getYear() :

As of JDK version 1.1, replaced by Calendar.get(Calendar.YEAR) - 1900

java.awt.Component.gotFocus(Event, Object) :

As of JDK version 1.1, replaced by processFocusEvent(FocusEvent)

java.awt.Component.handleEvent(Event) :

As of JDK version 1.1 replaced by processEvent(AWTEvent)

java.awt.Dialog.hide() :

As of JDK version 1.5, replaced by Component.setVisible(boolean)

java.awt.Component.hide() :

As of JDK version 1.1, replaced by setVisible(boolean)

java.awt.Window.hide() :

As of JDK 5, replaced by Component.setVisible(boolean)

java.lang.SecurityManager.inClass(String) :

This type of security checking is not recommended. It is recommended that the checkPermission call be used instead

java.lang.SecurityManager.inClassLoader() :

This type of security checking is not recommended. It is recommended that the checkPermission call be used instead

org.omg.CORBA.Any.insert_Principal(Principal) :

Deprecated by CORBA 2.2

javax.swing.text.html.HTMLEditorKit.InsertHTMLTextAction.insertAtBoundry(JEditorPane, HTMLDocument, int, Element, String, HTML.Tag, HTML.Tag) :

As of Java 2 platform v1.3, use insertAtBoundary :

java.awt.TextArea.insertText(String, int) :

As of JDK version 1.1, replaced by insert(String, int)

java.awt.Container.insets() :

As of JDK version 1.1, replaced by getInsets()

java.awt.Polygon.inside(int, int) :

As of JDK version 1.1, replaced by contains(int, int)

java.awt.Rectangle.inside(int, int) :

As of JDK version 1.1, replaced by contains(int, int)

java.awt.Component.inside(int, int) :

As of JDK version 1.1, replaced by contains(int, int)

java.rmi.server.RemoteRef.invoke(RemoteCall) :

1.2 style stubs no longer use this method. Instead of using a sequence of method calls to the remote reference (newCall, invoke, and done), a stub uses a single method, invoke(Remote, Method, Object[], int), on the remote reference to carry out parameter marshalling, remote method executing and unmarshalling of the return value

org.omg.CORBA.DynamicImplementation.invoke(ServerRequest) :

Deprecated by Portable Object Adapter :

javax.swing.JViewport.isBackingStoreEnabled() :

As of Java 2 platform v1.3, replaced by getScrollMode()

javax.swing.FocusManager.isFocusManagerEnabled() :

As of 1.4, replaced by KeyboardFocusManager.getDefaultFocusTraversalPolicy() :

java.awt.Component.isFocusTraversable() :

As of 1.4, replaced by isFocusable()

java.lang.Character.isJavaLetter(char) :

Replaced by isJavaIdentifierStart(char)

java.lang.Character.isJavaLetterOrDigit(char) :

Replaced by isJavaIdentifierPart(char)

javax.swing.JComponent.isManagingFocus() :

As of 1.4, replaced by Component.setFocusTraversalKeys(int, Set) and Container.setFocusCycleRoot(boolean)

java.awt.List.isSelected(int) :

As of JDK version 1.1, replaced by isIndexSelected(int)

java.lang.Character.isSpace(char) :

Replaced by isWhitespace(char)

java.rmi.dgc.VMID.isUnique() :

java.awt.Component.keyDown(Event, int) :

As of JDK version 1.1, replaced by processKeyEvent(KeyEvent)

java.awt.Component.keyUp(Event, int) :

As of JDK version 1.1, replaced by processKeyEvent(KeyEvent)

java.awt.ScrollPane.layout() :

As of JDK version 1.1, replaced by doLayout()

java.awt.Component.layout() :

As of JDK version 1.1, replaced by doLayout()

java.awt.Container.layout() :

As of JDK version 1.1, replaced by doLayout()

java.rmi.server.LoaderHandler.loadClass(String) :

no replacement

java.rmi.server.RMIClassLoader.loadClass(String) :

replaced by loadClass(String,String) method :

java.rmi.server.LoaderHandler.loadClass(URL, String) :

no replacement

java.awt.Component.locate(int, int) :

As of JDK version 1.1, replaced by getComponentAt(int, int)

java.awt.Container.locate(int, int) :

As of JDK version 1.1, replaced by getComponentAt(int, int)

java.awt.Component.location() :

As of JDK version 1.1, replaced by getLocation()

java.rmi.server.LogStream.log(String) :

no replacement

java.awt.Component.lostFocus(Event, Object) :

As of JDK version 1.1, replaced by processFocusEvent(FocusEvent)

java.awt.TextArea.minimumSize() :

As of JDK version 1.1, replaced by getMinimumSize()

java.awt.List.minimumSize() :

As of JDK version 1.1, replaced by getMinimumSize()

java.awt.TextField.minimumSize() :

As of JDK version 1.1, replaced by getMinimumSize()

java.awt.Component.minimumSize() :

As of JDK version 1.1, replaced by getMinimumSize()

java.awt.Container.minimumSize() :

As of JDK version 1.1, replaced by getMinimumSize()

java.awt.List.minimumSize(int) :

As of JDK version 1.1, replaced by getMinimumSize(int)

java.awt.TextField.minimumSize(int) :

As of JDK version 1.1, replaced by getMinimumSize(int)

java.awt.TextArea.minimumSize(int, int) :

As of JDK version 1.1, replaced by getMinimumSize(int, int)

javax.swing.text.View.modelToView(int, Shape) :

java.awt.Component.mouseDown(Event, int, int) :

As of JDK version 1.1, replaced by processMouseEvent(MouseEvent)

java.awt.Component.mouseDrag(Event, int, int) :

As of JDK version 1.1, replaced by processMouseMotionEvent(MouseEvent)

java.awt.Component.mouseEnter(Event, int, int) :

As of JDK version 1.1, replaced by processMouseEvent(MouseEvent)

java.awt.Component.mouseExit(Event, int, int) :

As of JDK version 1.1, replaced by processMouseEvent(MouseEvent)

java.awt.Component.mouseMove(Event, int, int) :

As of JDK version 1.1, replaced by processMouseMotionEvent(MouseEvent)

java.awt.Component.mouseUp(Event, int, int) :

As of JDK version 1.1, replaced by processMouseEvent(MouseEvent)

java.awt.Rectangle.move(int, int) :

As of JDK version 1.1, replaced by setLocation(int, int)

java.awt.Component.move(int, int) :

As of JDK version 1.1, replaced by setLocation(int, int)

org.omg.CORBA.Principal.name() :

Deprecated by CORBA 2.2

org.omg.CORBA.Principal.name(byte[]) :

Deprecated by CORBA 2.2

java.rmi.server.RemoteRef.newCall(RemoteObject, Operation[], int, long) :

1.2 style stubs no longer use this method. Instead of using a sequence of method calls on the stub's the remote reference (newCall, invoke, and done), a stub uses a single method, invoke(Remote, Method, Object[], int), on the remote reference to carry out parameter marshalling, remote method executing and unmarshalling of the return value

java.awt.Component.nextFocus() :

As of JDK version 1.1, replaced by transferFocus()

java.awt.datatransfer.DataFlavor.normalizeMimeType(String) :

java.awt.datatransfer.DataFlavor.normalizeMimeTypeParameter(String, String) :

org.omg.CORBA.ServerRequest.op_name() :

use operation() :

org.omg.CORBA.ServerRequest.params(NVList) :

use the method arguments :

java.util.Date.parse(String) :

As of JDK version 1.1, replaced by DateFormat.parse(String s)

java.rmi.server.LogStream.parseLevel(String) :

no replacement

java.awt.MenuComponent.postEvent(Event) :

As of JDK version 1.1, replaced by dispatchEvent

java.awt.MenuContainer.postEvent(Event) :

As of JDK version 1.1 replaced by dispatchEvent(AWTEvent)

java.awt.Component.postEvent(Event) :

As of JDK version 1.1, replaced by dispatchEvent(AWTEvent)

java.awt.Window.postEvent(Event) :

As of JDK version 1.1 replaced by dispatchEvent(AWTEvent)

java.awt.image.renderable.RenderContext.preConcetenateTransform(AffineTransform) :

replaced by preConcatenateTransform(AffineTransform)

java.awt.TextArea.preferredSize() :

As of JDK version 1.1, replaced by getPreferredSize()

java.awt.List.preferredSize() :

As of JDK version 1.1, replaced by getPreferredSize()

java.awt.TextField.preferredSize() :

As of JDK version 1.1, replaced by getPreferredSize()

java.awt.Component.preferredSize() :

As of JDK version 1.1, replaced by getPreferredSize()

java.awt.Container.preferredSize() :

As of JDK version 1.1, replaced by getPreferredSize()

java.awt.List.preferredSize(int) :

As of JDK version 1.1, replaced by getPreferredSize(int)

java.awt.TextField.preferredSize(int) :

As of JDK version 1.1, replaced by getPreferredSize(int)

java.awt.TextArea.preferredSize(int, int) :

As of JDK version 1.1, replaced by getPreferredSize(int, int)

org.omg.CORBA.portable.InputStream.read_Principal() :

Deprecated by CORBA 2.2

java.io.DataInputStream.readLine() :

This method does not properly convert bytes to characters. As of JDK 1.1, the preferred way to read lines of text is via the BufferedReader.readLine() method. Programs that use the DataInputStream class to read lines can be converted to use the BufferedReader class by replacing code of the form::

DataInputStream d = new DataInputStream(in);

with

BufferedReader d

= new BufferedReader(new InputStreamReader(in));

java.io.ObjectInputStream.readLine() :

This method does not properly convert bytes to characters. see DataInputStream for the details and alternatives

java.rmi.registry.RegistryHandler.registryImpl(int) :

no replacement. As of the Java 2 platform v1.2, RMI no longer uses the RegistryHandler to obtain the registry's implementation

java.rmi.registry.RegistryHandler.registryStub(String, int) :

no replacement. As of the Java 2 platform v1.2, RMI no longer uses the RegistryHandler to obtain the registry's stub

java.rmi.server.RemoteCall.releaseInputStream() :

no replacement

java.rmi.server.RemoteCall.releaseOutputStream() :

no replacement

javax.swing.plaf.metal.MetalComboBoxUI.removeListeners() :

As of Java 2 platform v1.4

java.awt.TextArea.replaceText(String, int, int) :

As of JDK version 1.1, replaced by replaceRange(String, int, int)

javax.swing.JComponent.requestDefaultFocus() :

As of 1.4, replaced by FocusTraversalPolicy.getDefaultComponent(Container).requestFocus() :

java.awt.Rectangle.reshape(int, int, int, int) :

As of JDK version 1.1, replaced by setBounds(int, int, int, int)

java.awt.Component.reshape(int, int, int, int) :

As of JDK version 1.1, replaced by setBounds(int, int, int, int)

javax.swing.JComponent.reshape(int, int, int, int) :

As of JDK 5, replaced by Component.setBounds(int, int, int, int).:

Moves and resizes this component

java.awt.Component.resize(Dimension) :

As of JDK version 1.1, replaced by setSize(Dimension)

java.awt.Rectangle.resize(int, int) :

As of JDK version 1.1, replaced by setSize(int, int)

java.awt.Component.resize(int, int) :

As of JDK version 1.1, replaced by setSize(int, int)

org.omg.CORBA.ServerRequest.result(Any) :

use the method set_result :

java.lang.Thread.resume() :

This method exists solely for use with Thread.suspend(), which has been deprecated because it is deadlock-prone. For more information, see Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?

java.lang.ThreadGroup.resume() :

This method is used solely in conjunction with Thread.suspend and ThreadGroup.suspend, both of which have been deprecated, as they are inherently deadlock-prone. See Thread.suspend() for details

java.lang.System.runFinalizersOnExit(boolean) :

This method is inherently unsafe. It may result in finalizers being called on live objects while other threads are concurrently manipulating those objects, resulting in erratic behavior or deadlock

java.lang.Runtime.runFinalizersOnExit(boolean) :

This method is inherently unsafe. It may result in finalizers being called on live objects while other threads are concurrently manipulating those objects, resulting in erratic behavior or deadlock

java.util.Properties.save(OutputStream, String) :

This method does not throw an IOException if an I/O error occurs while saving the property list. The preferred way to save a properties list is via the store(OutputStream out, String comments) method or the storeToXML(OutputStream os, String comment) method

java.net.MulticastSocket.send(DatagramPacket, byte) :

Use the following code or its equivalent instead: ...... int ttl = mcastSocket.getTimeToLive(); mcastSocket.setTimeToLive(newttl); mcastSocket.send(p); mcastSocket.setTimeToLive(ttl); .....

javax.swing.JViewport.setBackingStoreEnabled(boolean) :

As of Java 2 platform v1.3, replaced by setScrollMode()

java.awt.CheckboxGroup.setCurrent(Checkbox) :

As of JDK version 1.1, replaced by setSelectedCheckbox(Checkbox)

java.awt.Frame.setCursor(int) :

As of JDK version 1.1, replaced by Component.setCursor(Cursor)

java.sql.Time.setDate(int) :

java.util.Date.setDate(int) :

As of JDK version 1.1, replaced by Calendar.set(Calendar.DAY_OF_MONTH, int date)

java.net.URLConnection.setDefaultRequestProperty(String, String) :

The instance specific setRequestProperty method should be used after an appropriate instance of URLConnection is obtained. Invoking this method will have no effect

java.rmi.server.LogStream.setDefaultStream(PrintStream) :

no replacement

java.awt.TextField.setEchoCharacter(char) :

As of JDK version 1.1, replaced by setEchoChar(char)

java.sql.Date.setHours(int) :

java.util.Date.setHours(int) :

As of JDK version 1.1, replaced by Calendar.set(Calendar.HOUR_OF_DAY, int hours)

javax.swing.AbstractButton.setLabel(String) :

- Replaced by setText(text) :

java.awt.Scrollbar.setLineIncrement(int) :

As of JDK version 1.1, replaced by setUnitIncrement(int)

java.sql.DriverManager.setLogStream(PrintStream) :

javax.management.ValueExp.setMBeanServer(MBeanServer) :

This method is not needed because a ValueExp can access the MBean server in which it is being evaluated by using QueryEval.getMBeanServer()

javax.swing.JInternalFrame.setMenuBar(JMenuBar) :

As of Swing version 1.0.3 replaced by setJMenuBar(JMenuBar m)

javax.swing.JRootPane.setMenuBar(JMenuBar) :

As of Swing version 1.0.3 replaced by setJMenuBar(JMenuBar menu)

java.sql.Date.setMinutes(int) :

java.util.Date.setMinutes(int) :

As of JDK version 1.1, replaced by Calendar.set(Calendar.MINUTE, int minutes). :

java.awt.event.KeyEvent.setModifiers(int) :

as of JDK1.1.4 :

java.sql.Time.setMonth(int) :

java.util.Date.setMonth(int) :

As of JDK version 1.1, replaced by Calendar.set(Calendar.MONTH, int month)

java.awt.List.setMultipleSelections(boolean) :

As of JDK version 1.1, replaced by setMultipleMode(boolean)

javax.swing.JComponent.setNextFocusableComponent(Component) :

As of 1.4, replaced by FocusTraversalPolicy :

javax.management.monitor.MonitorMBean.setObservedObject(ObjectName) :

As of JMX 1.2, replaced by MonitorMBean.addObservedObject(javax.management.ObjectName) :

javax.management.monitor.Monitor.setObservedObject(ObjectName) :

As of JMX 1.2, replaced by Monitor.addObservedObject(javax.management.ObjectName) :

java.rmi.server.LogStream.setOutputStream(OutputStream) :

no replacement

java.awt.Scrollbar.setPageIncrement(int) :

As of JDK version 1.1, replaced by setBlockIncrement()

java.security.Signature.setParameter(String, Object) :

Use setParameter

java.rmi.server.RemoteStub.setRef(RemoteStub, RemoteRef) :

no replacement. The setRef method is not needed since RemoteStubs can be created with the RemoteStub(RemoteRef) constructor

java.sql.Date.setSeconds(int) :

java.util.Date.setSeconds(int) :

As of JDK version 1.1, replaced by Calendar.set(Calendar.SECOND, int seconds). :

javax.management.monitor.CounterMonitorMBean.setThreshold(Number) :

As of JMX 1.2, replaced by CounterMonitorMBean.setInitThreshold(java.lang.Number) :

javax.management.monitor.CounterMonitor.setThreshold(Number) :

As of JMX 1.2, replaced by CounterMonitor.setInitThreshold(java.lang.Number) :

java.net.MulticastSocket.setTTL(byte) :

use the setTimeToLive method instead, which uses int instead of byte as the type for ttl

java.net.DatagramSocketImpl.setTTL(byte) :

use setTimeToLive instead

java.sql.PreparedStatement.setUnicodeStream(int, InputStream, int) :

javax.sql.rowset.BaseRowSet.setUnicodeStream(int, InputStream, int) :

getCharacterStream should be used in its place :

java.net.URLStreamHandler.setURL(URL, String, String, int, String, String) :

Use setURL(URL, String, String, int, String, String, String, String); :

java.sql.Time.setYear(int) :

java.util.Date.setYear(int) :

As of JDK version 1.1, replaced by Calendar.set(Calendar.YEAR, year + 1900)

java.awt.Dialog.show() :

As of JDK version 1.5, replaced by Component.setVisible(boolean)

java.awt.Component.show() :

As of JDK version 1.1, replaced by setVisible(boolean)

java.awt.Window.show() :

As of JDK 5, replaced by Component.setVisible(boolean)

java.awt.Component.show(boolean) :

As of JDK version 1.1, replaced by setVisible(boolean)

java.awt.Component.size() :

As of JDK version 1.1, replaced by getSize()

javax.swing.JTable.sizeColumnsToFit(boolean) :

As of Swing version 1.0.3, replaced by doLayout()

java.lang.Thread.stop() :

This method is inherently unsafe. Stopping a thread with Thread.stop causes it to unlock all of the monitors that it has locked (as a natural consequence of the unchecked ThreadDeath exception propagating up the stack). If any of the objects previously protected by these monitors were in an inconsistent state, the damaged objects become visible to other threads, potentially resulting in arbitrary behavior. Many uses of stop should be replaced by code that simply modifies some variable to indicate that the target thread should stop running. The target thread should check this variable regularly, and return from its run method in an orderly fashion if the variable indicates that it is to stop running. If the target thread waits for long periods (on a condition variable, for example), the interrupt method should be used to interrupt the wait. For more information, see Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?

java.lang.ThreadGroup.stop() :

This method is inherently unsafe. See Thread.stop() for details

java.lang.Thread.stop(Throwable) :

This method is inherently unsafe. See Thread.stop() for details. An additional danger of this method is that it may be used to generate exceptions that the target thread is unprepared to handle (including checked exceptions that the thread could not possibly throw, were it not for this method). For more information, see Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?

java.lang.Thread.suspend() :

This method has been deprecated, as it is inherently deadlock-prone. If the target thread holds a lock on the monitor protecting a critical system resource when it is suspended, no thread can access this resource until the target thread is resumed. If the thread that would resume the target thread attempts to lock this monitor prior to calling resume, deadlock results. Such deadlocks typically manifest themselves as "frozen" processes. For more information, see Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?

java.lang.ThreadGroup.suspend() :

This method is inherently deadlock-prone. See Thread.suspend() for details

java.util.Date.toGMTString() :

As of JDK version 1.1, replaced by DateFormat.format(Date date), using a GMT TimeZone

java.util.Date.toLocaleString() :

As of JDK version 1.1, replaced by DateFormat.format(Date date)

java.rmi.server.LogStream.toString() :

no replacement

java.rmi.server.Operation.toString() :

no replacement

java.io.ByteArrayOutputStream.toString(int) :

This method does not properly convert bytes into characters. As of JDK 1.1, the preferred way to do this is via the toString(String enc) method, which takes an encoding-name argument, or the toString() method, which uses the platform's default character encoding

java.util.Date.UTC(int, int, int, int, int, int) :

As of JDK version 1.1, replaced by Calendar.set(year + 1900, month, date, hrs, min, sec) or GregorianCalendar(year + 1900, month, date, hrs, min, sec), using a UTC TimeZone, followed by Calendar.getTime().getTime()

javax.swing.text.View.viewToModel(float, float, Shape) :

org.omg.CORBA.portable.OutputStream.write_Principal(Principal) :

Deprecated by CORBA 2.2

java.rmi.server.LogStream.write(byte[], int, int) :

no replacement

java.rmi.server.LogStream.write(int) :

no replacement

java.io.ObjectOutputStream.PutField.write(ObjectOutput) :

This method does not write the values contained by this PutField object in a proper format, and may result in corruption of the serialization stream. The correct way to write PutField data is by calling the ObjectOutputStream.writeFields() method.

Previous Home Next