Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

course description; design and create advanced web-based applications. Content w

ID: 3838695 • Letter: C

Question

course description;

design and create advanced web-based applications. Content will consist of hands-on experience with advanced Java and scripting language applications. Topics will include the development of applications to provide web-based interfaces for relational databases.


questions:

1. Which keyword is used to place GUI components such as labels and buttons into a frame?





2. numWildCur = new JTextField (3)
What is the maximum number of characters that can be input into numWildCur?




3. public class RockyMountainMarketingPanel extends JPanel
What does the extends keyword do?





4. The output of the following code snippet will be _______________.

int [ ] scores = new int [5];
scores [5] = 47;
System.out.println (scores [5]);

Explanation / Answer

Please follow the data and description :

1) Implements :

In practice only a single class could be extended for a parent java class wherein a single class entension would not be a useful case as there would me more number of class and their respective methods that are need to be used in the creation of a Java GUI class. So to overcome this the parent class implements a class such as the ActionListener as the interfaces. So the parent class can extend a main class and then even can use the IMPLEMENTS keyword to add the button/event handling/labels handling.

So the answer is IMPLEMENTS.

2)

The line of code new JTextField() creates a new TextField, now when specified with the number within the barckets this conveys the number of columns or the maximum number of character the object could hold. So for the given code numWildCur = new JTextField (3) the object numWildCur can accept a maximum of 3 characters.

3)

Extends Keyword : In java extends is a keyword that is in genreal used to inherit or obtain all the properties of a class. This follows the java property or the feature named as inheritance that is defined as the process where one class acquires the properties of another class. So this feature could be used with the help of the EXTENDS keyword.

4)

For the given code

int [ ] scores = new int [5];
scores [5] = 47;
System.out.println (scores [5]);

below is the output

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 5
   at sample.main(Main.java:14)

  
This is because the array could hold only five elements with indexes between 0-4, wherein 5 is an array out of the index, so an exception is raised.

Hope this is helpful.