EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
8th Edition
ISBN: 9781305480537
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
bartleby

Concept explainers

Expert Solution & Answer
Book Icon
Chapter 7, Problem 9RQ

<PROGRAM-DESCRIPTION-ANSWER>

The expression name1.compareTo(name2) contains the value “-1”.

Hence, the correct option is “C”.

</PROGRAM-DESCRIPTION-ANSWER>

Explanation of Solution

Given:

String name1 = new String ("Jordan");

String name2 = new String ("Jore");

To find:

name1.compareTo (name2)

Explanation:

  • Here, “name1” is the string variable and assign with a string value “Jordan”.
  • The “name2” is the string variable and assign with a string value “Jore”...

Blurred answer
Students have asked these similar questions
Can you please clean up my code? Because i think there is an implementation problem in the middle. Thank you.  I have attached the airportqueuedata.txt as a screenshot.    #include <iostream> #include <fstream> #include <string>   using namespace std;   void enqQ(int&); void deqQ(int&); void clearQ(int&, int&); bool isEmpty(int, int); bool isFull(int, int);     struct planes // data type plane declared via struct { stringrequest; stringflightNum; stringstartingPoint; stringdestination; stringnumberOfPassengers; };   void enqQ(int& rear) // adds data to queue { rear = (rear + 1) % 10; }   void deqQ(int& front) // delets data from queue { front = (front + 1) % 10; }   void clearQ(int& front, int& rear) // clears queue { front = -1; rear = -1; }   bool isEmpty(int front, int rear) // tells if queue is empty or not { if (rear == front) return true; else return false; }   bool isFull(int front, int rear) // tells if queue is full or not { if…
I have the following JAVA code using JFRAME: String[] headers = {"Username", "First Name", "Middle Name", "Last Name"}; JSONArray jsonArray = readJSONFile("src/registration.json");for (int i = 0; i < jsonArray.size(); i++) {JSONObject obj = (JSONObject) jsonArray.get(i);String uName = (String) obj.get("username");String fName = (String) obj.get("firstName");String mName = (String) obj.get("middleName");String lName = (String) obj.get("lastName");Object[] row = {uName, fName, mName, lName};tableModel.addRow(row);} My code displays data for each registrant in a table format. Please add an action listener to my GUI code that will delete the selected data from the JSON file.
I have the following JAVA code using JFRAME: String[] headers = {"Username", "First Name", "Middle Name", "Last Name"}; JSONArray jsonArray = readJSONFile("src/registration.json");for (int i = 0; i < jsonArray.size(); i++) {JSONObject obj = (JSONObject) jsonArray.get(i);String uName = (String) obj.get("username");String fName = (String) obj.get("firstName");String mName = (String) obj.get("middleName");String lName = (String) obj.get("lastName");Object[] row = {uName, fName, mName, lName};tableModel.addRow(row);} My code displays data for each registrant in a table format. Please add an action listener to my GUI code that will write the data of the selected row to a separate JSON file.
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage