Question

(TCO 1) The JVM executes a Java application by (Points : 6)        executing the public static...

(TCO 1) The JVM executes a Java application by (Points : 6)

       executing the public static main method of the class.
       creating an object of the class and executing that object’s main method.
       executing the class constructor.
       compiling the Java code into byte code.

(TCO 1) Which method call converts the value in variable stringVariable to a double? (Points : 6)
       Double.parseDouble( stringVariable );
       Convert.toDouble( stringVariable );
       Convert.parseDouble( stringVariable );
       Float.parseFloat( stringVariable );
(TCO 1) Which of the following can be used to get a double value from the keyboard? (Points : 6)

       Formatter input = new Formatter(System.in); double value = input.nextDouble( );
       Scanner input = new Scanner(System.out); double value = input.nextDouble( );
       Formatter input = new Formatter(System.out); double value = input.nextDouble( );
       Scanner input = new Scanner(System.in); double value = input.nextDouble( );

(TCO 1) If a user inputs 12.34 into the dialog box displayed by the showInputDialog method of the JOptionPane class, what type of value will be returned from that method? (Points : 6)

       A double value
       A string value
       A float value
       It depends on what type of value the user was told to input.

(TCO 1) What do the following statements do?
            int array[ ] = {1,2,3,4,5};
            int len = array.length; (Points : 6)

       Creates an integer array containing 5 elements.
       Initializes the array elements to the listed values.
       Stores the number of elements in the array in the len variable.
       All of the above.

(TCO 2) Variables should be declared as local variables of a method if (Points : 6)

       they are used as arguments to other methods of the class.
       their values are only used by the method.
       their values must be shared between different methods of the class.
       they are method parameters.

(TCO 2) What is a primary difference between inheritance in Java and inheritance in C++? (Points : 6)

       C++ permits derived classes to execute base class constructors, Java does not.
       Inheritance in Java is protected, whereas in C++ it can be public, private, or protected.
       C++ permits inheritance from multiple classes, Java does not.
       Java allows multiple inheritance, C++ does not.

. (TCO 3) What can you say about the following Java class?

            public class MyApp extends JFrame { … } (Points : 6)

       MyApp will contain a JFrame object which provides the display window.
       MyApp inherits from JFrame, so it is a customized window.
       MyApp will access JFrame methods by doing objectName.methodName(….).
       MyApp will need to override JFrame methods to display buttons in the window

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
(TCO 1) The JVM executes a Java application by (Points : 6)        executing the public static...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • Write a Java method that should take an ArrayList as a parameter, print its element in...

    Write a Java method that should take an ArrayList as a parameter, print its element in the reverse order. The main function that calls the method is the following: import java.util.*; public class ReverseGen {   public static void main(String[] args) {     Scanner input = new Scanner(System.in);       System.out.println("How many numbers do you want to input?");       int num = input.nextInt();       ArrayList<Double> d = new ArrayList<Double>(num);       for(int i = 0 ; i < num; i++){           System.out.print("Enter...

  • A class Scanner in Java can be used to get user input and its methods can...

    A class Scanner in Java can be used to get user input and its methods can be used after the following statement is executed: Scanner input = new Scanner(System.in); One of its methods nextDouble() returns the next double value from the keyboard. Now you are requested to write a method enterHeight() which displays the message "Input height: " and uses the method input.nextDouble() to get the user input. The process should be repeated until the input is non-negative. Finally the...

  • This is the contents of Lab11.java import java.util.Scanner; import java.io.*; public class Lab11 { public static...

    This is the contents of Lab11.java import java.util.Scanner; import java.io.*; public class Lab11 { public static void main(String args[]) throws IOException { Scanner inFile = new Scanner(new File(args[0])); Scanner keyboard = new Scanner(System.in);    TwoDArray array = new TwoDArray(inFile); inFile.close(); int numRows = array.getNumRows(); int numCols = array.getNumCols(); int choice;    do { System.out.println(); System.out.println("\t1. Find the number of rows in the 2D array"); System.out.println("\t2. Find the number of columns in the 2D array"); System.out.println("\t3. Find the sum of elements...

  • (a) A class Scanner in Java can be used to get user input and its methods...

    (a) A class Scanner in Java can be used to get user input and its methods can be used after the following statement is executed: Scanner input = new Scanner(System.in); One of its methods nextDouble() returns the next double value from the keyboard. Now you are requested to write a method enterHeight() which displays the message "Input height: " and uses the method input.nextDouble() to get the user input. The process should be repeated until the input is non-negative. Finally...

  • import java.util.Scanner; public class MPGMain {    public static void main(String[] args)    {       ...

    import java.util.Scanner; public class MPGMain {    public static void main(String[] args)    {        Scanner input = new Scanner(System.in);               Mileage mileage = new Mileage();               System.out.println("Enter your miles: ");        mileage.setMiles(input.nextDouble());               System.out.println("Enter your gallons: ");        mileage.setGallons(input.nextDouble());               System.out.printf("MPG : %.2f",mileage.getMPG());           } } public class Mileage {    private double miles;    private double gallons;    public double getMiles()...

  • Java Program 1. Write a class that reads in a group of test scores (positive integers...

    Java Program 1. Write a class that reads in a group of test scores (positive integers from 1 to 100) from the keyboard. The main method of the class calls a few other methods to calculate the average of all the scores as well as the highest and lowest score. The number of scores is undetermined but there will be no more than 50. A negative value is used to end the input loop. import java.util.Scanner; public class GradeStat {...

  • Question 216 pts (TCO 2) In order to guarantee that only one JRadioButton is selected at...

    Question 216 pts (TCO 2) In order to guarantee that only one JRadioButton is selected at any time, _____. add each JRadioButton object to a different panel create a ButtonGroup object and add the JRadioBttons to it have a JCheckBox object manage the three JRadioButtons This cannot be done in Java. Flag this Question Question 226 pts (TCO 2) Which Java interface would you need to implement in order to handle events such as key-pressed or key-released events? KeyListener interface...

  • Submit Chapter6.java with a public static method named justifyText that accepts two parameters; a Scanner representing...

    Submit Chapter6.java with a public static method named justifyText that accepts two parameters; a Scanner representing a file as the first parameter, and an int width specifying the output text width. Your method writes the text file contents to the console in full justification form (I'm sure you've seen this in Microsoft Word full.docx ).  For example, if a Scanner is reading an input file containing the following text: Four score and seven years ago our fathers brought forth on this...

  • I need the following java code commented import java.util.Scanner; public class Main { public static void...

    I need the following java code commented import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input = new Scanner (System.in); int productNo=0; double product1; double product2; double product3; double product4; double product5; int quantity; double totalsales=0; while(productNo !=0) System.out.println("Enter Product Number 1-5"); productNo=input.nextInt(); System.out.println("Enter Quantity Sold"); quantity=input.nextInt(); switch (productNo) { case 1: product1=1.00; totalsales+=(1.00*quantity); break; case 2: product2=2.00; totalsales+=(2.00*quantity); break; case 3: product3=6.00; totalsales+=(6.00*quantity); break; case 4: product4=23.00; totalsales+=(23.00*quantity); break; case 5: product5=17.00; totalsales+=(17.00*quantity); break;...

  • ****Here is the assignment **** Purpose: To write an Object-Oriented application that creates a Java class...

    ****Here is the assignment **** Purpose: To write an Object-Oriented application that creates a Java class with several instance variables, a constructor to initialize the instance variables, several methods to access and update the instance variables’ values, along with other methods to perform calculations. Also, write a test class that instantiates the first class and tests the class’s constructor and methods. Details: Create a class called Rectangle containing the following: Two instance variables, An instance variable of type double used...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT