1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Misha Larkins [42]
3 years ago
15

Which statement creates a StudentIDs object given the following code: public class StudentIDs> { private TheType item1; priva

te TheType item2; public StudentIDs(TheType i1, TheType i2) { item1 = i1; item2 = i2; } }
a. StudentIDs newStudent = new StudentIDs(9, 5);
b. StudentIDs newStudent = new StudentIDs (Integer iVal1, Integer iVal2);
c. StudentIDs newStudent = new StudentIDs(int iVal1, int iVal2);
d. StudentIDs newStudent = new StudentIDs(9, 5);
Computers and Technology
1 answer:
Marizza181 [45]3 years ago
3 0

Answer:

StudentIDs<TheType> newStudent = new StudentIDs<TheType>(9,5);

Explanation:

Required

Which statement creates a studentIDs object

The question has conflicting details as none of the options is true because some definitions that do not appear in the options.

So, I will answer the question based on the definition in the question.

From the question, we have the class definition to be:

public class StudentIDs<TheType extends Comparable<TheType>>

The above definition is a simple generic java class that follows:

public class Class-Name<Variable-name extends Comparable<Variable-name>>

The object of the class will be created using the following syntax:

Class-Name<TheType> Object-Name = new Class-Name<TheType>();

By comparison:

Class-Name = StudentIDs

Variable-name = TheType

So, the object will be defined as:

StudentIDs<TheType> newStudent = new StudentIDs<TheType>();

Solving further:

The class declares two variables (i1 and i2) as follows:

public StudentIDs(TheType i1, TheType i2)

This means that two TheType variables and/or values will be passed along with the definition of the class.

So, the object definition will be:

StudentIDs<TheType> newStudent = new StudentIDs<TheType>(9,5);

You might be interested in
Write a static method called bothStart that allows the user to input two Strings and returns the String that is the longest subs
marishachu [46]

Answer:

  1.    public static String bothStart(String text1, String text2){
  2.        String s = "";
  3.        if(text1.length() > text2.length()) {
  4.            for (int i = 0; i < text2.length(); i++) {
  5.                if (text1.charAt(i) == text2.charAt(i)) {
  6.                    s += text1.charAt(i);
  7.                }else{
  8.                    break;
  9.                }
  10.            }
  11.            return s;
  12.        }else{
  13.            for (int i = 0; i < text1.length(); i++) {
  14.                if (text1.charAt(i) == text2.charAt(i)) {
  15.                    s += text1.charAt(i);
  16.                }else{
  17.                    break;
  18.                }
  19.            }
  20.            return s;
  21.        }
  22.    }

Explanation:

Let's start with creating a static method <em>bothStart()</em> with two String type parameters, <em>text1 </em>&<em> text2</em> (Line 1).  

<em />

Create a String type variable, <em>s,</em> which will hold the value of the longest substring that both inputs start with the same character (Line 2).

There are two possible situation here: either <em>text1 </em>longer than<em> text2 </em>or vice versa. Hence, we need to create if-else statements to handle these two position conditions (Line 4 & Line 13).

If the length of<em> text1</em> is longer than <em>text2</em>, the for-loop should only traverse both of strings up to the length of the <em>text2 </em>(Line 5). Within the for-loop, we can use<em> charAt()</em> method to extract individual character from the<em> text1</em> & <em>text2 </em>and compare with each other (Line 15). If they are matched, the character should be joined with the string s (Line 16). If not, break the loop.

The program logic from (Line 14 - 20) is similar to the code segment above (Line 4 -12) except for-loop traverse up to the length of <em>text1 .</em>

<em />

At the end, return the s as output (Line 21).

5 0
3 years ago
PUBG mobile id and name plz
ycow [4]
KSK Jemens je Jemen jeme this is mine
5 0
3 years ago
Please elp i will give you brainelst answer the question and answer please!!!!!!!!!!!!!!!!
vaieri [72.5K]

Answer:

I'd so like one of the Presidents.

Explanation:

research some facts. make sure to use your resources. Put some facts on who their vice president was a stuff

3 0
3 years ago
you would like to set up on online meeting to communicate with colleagues on a group project which of these tools should you sug
larisa86 [58]
Using group video conferencing , for example skype would be a great way to do this efficently with good audio and video and all would be able to communicate and send files together
5 0
4 years ago
Read 2 more answers
To convey points effectively on a slide, follow the
Deffense [45]
Follow the one-by-six-by-six rule (1-6-6) rule

This presentation rule in PowerPoint suggest that you should only have one idea per slide and include no more than six bullet points per slide and no more than six points per line. The goal for this rule is to avoid your slide from being so dense and packed with too much info.



6 0
3 years ago
Other questions:
  • You are tasked with securing a small network for a client in which the following requirements must be met: If a user on the priv
    8·1 answer
  • Will a tablecloth that is 155 cm long cover a table that is 1.6 m long?
    12·2 answers
  • How we can get NET I'D by IP Address?
    11·1 answer
  • Fair Use means a teacher can take the contents of a web activity page and repost it in your school's web site because it is for
    7·1 answer
  • The CSS property of top , bottom , left , or right moves the element the specified distance from the respective edge of the clos
    7·1 answer
  • When creating an electronic slide presentation, Lee should avoid
    8·1 answer
  • Which of these are examples of a bug?
    6·1 answer
  • A computer is performing a binary search on the sorted list of 7 numbers below.
    10·2 answers
  • Wilt short answer of the fol<br>What is an operating systeme te ay maglia<br>​
    12·1 answer
  • ค้้้้้้้้้้้้้้้้้้้­้้้้้้้้้้้้้้้้้้้้­้้้้้้้้้้้้้้้้้้้้­้้้้้้้้้้้้้้้้้้้้­้้้้้้้้้้้้้้้ ฏ๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎­๎๎๎๎๎๎๎
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!