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
AveGali [126]
3 years ago
10

What is wrong in the following code? class TempClass { int i; public void TempClass(int j) { int i = j; } } public class C { pub

lic static void main(String[] args) { TempClass temp = new TempClass(2); } }
Computers and Technology
1 answer:
Rom4ik [11]3 years ago
7 0

Answer:

In the given program,  a parameterized constructor declaration is wrong, which can be described as follows:

Explanation:

Code:

class TempClass //defining class TempClass

{

   int i; //defining integer varaible i

   TempClass(int j)//defining parameterized constructor

   {

   i = j; //variable holds a value

   System.out.print(i); //print value

   }

}

public class Main //defining class Main

{

   public static void main(String[] aw) //defining main method

   {

       TempClass temp =new TempClass(2); //creating class Object and call parameterized constructor.

   }

}

Description:

  • In the given java code, two classes "TempClass and Main" is defined, inside the TempClass class an integer variable "i" and a parameterized constructor is declared, inside the constructor integer variable "i"  hold constructor parameter value, the use print method to prints its value.  
  • Then the main class is defined, inside this main method is declared, in this method, the TempClass object "temp" is defined, that call the parameter constructor.
You might be interested in
How do you enter the command prompt on Chromebook
Step2247 [10]

1) Go through the standard Chrome OS login screen (you'll need to setup a network, etc) and get to the web browser. It's OK if you login as guest.

2) Press [ Ctrl ] [ Alt ] [ T ] to get the crosh shell.

3) Use the shell command to get the shell prompt.

3 0
2 years ago
The _______________ layer of the TCP/IP protocol suite is responsible for making sure that what leaves one end of the network ar
seropon [69]

Answer:

Transport layer

Explanation:

The transport layer is responsible for maintaining end to end communication between devices connected on a network.

The TCP/IP determines how data is exchanged between devices connected on a network by providing end to end communications that determines how it should be broken into packets.

7 0
3 years ago
A(n) _____ chart is drawn on the same worksheet as the data.
Harrizon [31]
The answer is An embedded chart
6 0
3 years ago
Someone who is young, lacks funds, and really wants to gain technical skills while serving his or her nation should consider
Scilla [17]
Hello there!

They already gave you the answer just by saying "while serving his or her nation". So, the only way you can serve your nation is when you join the military.

So, the correct missing word is Joining the military.


I hope this helps!
6 0
3 years ago
A data flow cannot go directly back to the same process it leaves. There must be at least ________ other process(es) that handle
Flauer [41]

Answer:

Answer is A. One.

Refer below.

Explanation:

A data flow cannot go directly back to the same process it leaves. There must be at least one other process that handle(s) the data flow, produce(s) some other data flow, and return(s) the original data flow to the beginning process.

3 0
3 years ago
Other questions:
  • Using the flowchart below, what value when entered for Y will generate a mathematical error and prevent our flowchart from being
    14·1 answer
  • Arrange these stages of website design in the order that they follow. developing planning learning designing testing and deliver
    12·1 answer
  • Which connector is most commonly used to connect printers to desktop pc systems?
    10·1 answer
  • Two electronics technicians are looking at the representations of a silver atom and a copper atom in the figure above. Technicia
    10·1 answer
  • Search engines enable you to
    14·1 answer
  • Help! live preview in brackets is not working
    8·1 answer
  • HURRY!! Ill give brainily and 25 points. Describe how Scent is related to the culture and historical period when it was created.
    15·1 answer
  • Who is the first British in Europe ​
    10·1 answer
  • PLEASE HELP!!<br> Would you ever try and get famous off of social media? Why or why not?
    6·2 answers
  • Edhesive 7.6 lesson practice python
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!