===== 3.2 select Method ===== Applets remain in a suspended state until they are explicitly selected. Selection occurs when the Java Card RE receives a SELECT FILE APDU command in which the name data matches the AID of the applet. Applet selection can also occur on a MANAGE CHANNEL OPEN command. Selection causes an applet to become the currently selected applet. For more details, see [[4.5_Applet Selection| Section 4.5, Applet Selection]]. Prior to calling **select**, the Java Card RE shall deselect the previously selected applet. The Java Card RE indicates this to the applet by invoking the applet's **deselect** method or, if concurrently selected on more than one logical channel, its **MultiSelectable.deselect** method (for more details, see [[4.2_Multiselectable Applets| Section 4.2, Multiselectable Applets]]). The Java Card RE informs the applet of selection by invoking its **select** method or, if being concurrently selected on more than one logical channel, its **MultiSelectable.select** method (for more details, see [[4.2_Multiselectable Applets| Section 4.2, Multiselectable Applets]]). The applet may decline to be selected by returning **false** from the call to the **select** method or by throwing an exception. If the applet returns **true**, the actual SELECT FILE APDU command is supplied to the applet in the subsequent call to its **process** method, so that the applet can examine the APDU contents. The applet can process the SELECT FILE APDU command exactly like it processes any other APDU command. It can respond to the SELECT FILE APDU with data (see [[3.3_process Method| Section 3.3, process Method]] for details), or it can flag errors by throwing an **ISOException** with the appropriate returned status word. The status word and optional response data are returned to the CAD. The **Applet.selectingApplet** method shall return **true** when called during the **select** method. The **Applet.selectingApplet** method continues to return **true** during the subsequent **process** method, which is called to process the SELECT FILE APDU command. If the applet declines to be selected, the Java Card RE returns an APDU response status word of **ISO7816.SW_APPLET_SELECT_FAILED** to the CAD. Upon selection failure, the Java Card RE state is set to indicate that no applet is selected. See [[4.5_Applet Selection| Section 4.5, Applet Selection]] for more details. After successful selection, all subsequent APDUs directed to the assigned logical channel are delivered to the currently selected applet via the **process** method.