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
  • 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 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...

  • (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()...

  • Programming: Java: Fixing errors in code help: The errors are in square.java and rectangle.java and they...

    Programming: Java: Fixing errors in code help: The errors are in square.java and rectangle.java and they both say: constructor Shape in class Shape cannot be applied to given types; required: no arguments found: String reason: actual and formal argument lists differ in length The directions say: The files Shape.java and TestArea.java have been finished already, YOU DONT ADD ANYTHING TO THESE TWO. According to the requirement, you need to modify in Square.java and Rectangle.java, respectively a. Implementing constructor with no...

  • 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...

  • I need to create a code for this prompt: In this project we will build a...

    I need to create a code for this prompt: In this project we will build a generic UserInput class for getting keyboard input from the user. Implementation: The class UserInput is a 'Methods only' class, and all the methods should be declared static. Look at the TestScanner.java program at the bottom of this page that inputs a string, int and double. It shows you how to use Scanner class to get input from the keyboard. Write FOUR simple methods, one...

  • pls help java ASAP!!!!!!! Topic String Tokenizer Static Methods Static Variables Primitive Arrays Description Enhance the...

    pls help java ASAP!!!!!!! Topic String Tokenizer Static Methods Static Variables Primitive Arrays Description Enhance the last assignment by providing the following additional features: (The additional features are listed in bold below) Class Statistics In the class Statistics, create the following static methods (in addition to the instance methods already provided). • A public static method for computing sorted data. • A public static method for computing min value. • A public static method for computing max value. • A...

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
ADVERTISEMENT