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
Dima020 [189]
3 years ago
8

java class What is the output of the following JAVA program (Java assumes public if no access modifier is given)? class Test { p

ublic static void main(String[] args) { Test obj = new Test(); obj.start(); } void start() { String stra = ""do""; String strb = method(stra); System.out.print("": ""+stra + strb); } String method(String stra) { stra = stra + ""good""; System.out.print(stra); return"" good""; } }
Computers and Technology
1 answer:
Natasha2012 [34]3 years ago
6 0

Answer:

The answer to the given question is it will produce an "error"  

Explanation:

In the given java program it will produce an error because in java we do not use double quote("""") for message printing. We use a single quote("") for message printing. In the given program if we use a single quote(""). so it will give output that is "dogood:dogood".

The correct program to this question is can be given as:

Program:

public class Test  //define a class test.

{

   public static void main(String[] args)  //define main method

   {

       Test obj = new Test();   //create class object  

       obj.start(); //calling function

   }  

   void start()  //define function start.  

   {

       String stra = "do";   //define variable and assign value.

       String strb = method(stra);  //define variable and pass stra variable in method() function as a parameter.

       System.out.print(":"+stra + strb); //print value.  

   }

   String method(String stra)  //define function method  

   {  

       stra = stra + "good";   //add value

       System.out.print(stra);  //print value of stra

       return"good";  //return value

   }

}

Output:

dogood:dogood

You might be interested in
Antifreeze is not considered a hazardous waste by the EPA unless it is used or otherwise becomes contaminated.
Ahat [919]

False might be the answer

6 0
3 years ago
Read 2 more answers
A(n) __________ port, also known as a monitoring port, is a specially configured connection on a network device that is capable
drek231 [11]

Answer:

The answer is "SPAN"

Explanation:

The full form of SPAN port is  "Switch Port Analyzer", which is used to designed specifically for the interface on a network device, that would be able to monitor all traffic passing across the entire device.

  • The use of this port will also call the mirror ports, that is a popular way of gathering data traffic for tracking purposes.
  • It is primarily used to access the bus switch and all interfaces, which is usually accessible from data transmission.
7 0
3 years ago
When working in excel online, which of the following is considered a conditional formula?
Alika [10]
B. Because conditional statements have an IF before stating the condition
8 0
3 years ago
Read 2 more answers
For the function below, which variables have the same scope?
steposvetlana [31]

Answer:

numB and power

Explanation:

Correct answer edge 2020

5 0
3 years ago
Read 2 more answers
Again, suppose that n and r denote integer values where r > 0 and n ≥ 0. What are two "simple" values, say lowEnough and tooH
enyata [817]

Answer:

Answer explained

Explanation:

From the previous question we know that while searching for n^(1/r) we don't have to look for guesses less than 0 and greater than n. Because for less than 0 it will be an imaginary number and for rth root of a non negative number can never be greater than itself. Hence lowEnough = 0 and tooHigh = n.

we need to find 5th root of 47226. The computation of root is costlier than computing power of a number. Therefore, we will look for a number whose 5th power is 47226. lowEnough = 0 and tooHigh = 47226 + 1. Question that should be asked on each step would be "Is 5th power of number < 47227?" we will stop when we find a number whose 5th power is 47226.

6 0
2 years ago
Other questions:
  • The color band that represents tolerance on a resistor is the?
    11·1 answer
  • Describe the positive and negative effects of Internet​
    6·2 answers
  • What was the process called that required the photographer to have a tent or darkroom handy so that chemicals could be mixed qui
    7·1 answer
  • What is the meaning of 4 8 15 16 23 42?
    14·1 answer
  • Assume that strikeCounter has already been declared to be a "pointer to int". Assume further that strikeCounter has been initial
    7·1 answer
  • Whats the formatting of a letter to the editor?​
    12·1 answer
  • Anyone know how to fix black screen of death on computer​
    6·1 answer
  • Write a class called TextProcessor that implements the methods listed below. Your implementation may use the charAt() and length
    14·1 answer
  • Molly claims that she doesn’t have to proofread her code for typos because the interpreter will catch her mistakes for her. Is s
    10·1 answer
  • How to do or create a shepard tone using additive synthesis in Pure Data. Please help, desperate!!
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!