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
Bertha was recording a drama club practice. during editing, she noticed that she missed recording the beginning of a shot in the
Ray Of Light [21]

Bertha should use end roll technique so that she doesn't miss the initial action of a drama.

b. end roll

<u>Explanation:</u>

End roll is a simple method to decide whether the film is pushing ahead or not. When you utilize the film advance to wind the film, you essentially need to check if the handle on the left (that you use to rewind the film) is turning.

In the event that it turns, great, it implies that the film is appropriately locked in. So Bertha should utilize the end move strategy with the goal that she doesn't miss the underlying activity of a dramatization.

5 0
3 years ago
Which of the following statements is false? a. Racks and bins are examples of storage equipment. b. Automation refers to equipme
svp [43]

Answer:

b. Automation refers to equipment that complements, rather than replaces, human contact.

3 0
3 years ago
2. Student organizations sometimes require transportation for off-campus activities, and school policy requires students to be o
Dafna11 [192]

Answer:

=IF(B2>=23,"Yes","No")

Explanation:

Given

Name = Kay Colbert

The Name column can't be used to determine the eligibility of a student to the transport.

What is needed is the corresponding age column of Kay's age.

Assume that the age column is B2 and the result column is C2 (See Attachment)

Enter the following in C2

=IF(B2>=23,"Yes","No")

This will return "Yes" without the quotes in cell C2 if B2 is greater than 23

Else, it'll return "No" without the quotes.

To drag the formula to other column, follow the instructions below

Select cell C2.

Rest your cursor in the lower-right corner so that it turns into a plus sign (+), like this:

Drag the fill handle downwards

3 0
3 years ago
Which does a traditional camera need in order to capture images?
pashok25 [27]

Answer:

I think secure digital is needed

3 0
3 years ago
How do u friend people
Verdich [7]
You click on the three dots and click the person silhouette with the plus sign on it.
4 0
3 years ago
Read 2 more answers
Other questions:
  • How does the occupational outlook affect the monetary benefits of a career
    11·1 answer
  • What is indentation?
    8·2 answers
  • 7. Which innovation in video games do you think has been most significant? Include at least one way that innovation affects the
    6·1 answer
  • As the new manager at your local grocery store, you want to create a more efficient inventory process by allowing outside vendor
    6·1 answer
  • Mobile computing has two major characteristics that differentiate it from other forms of computing. What are these two character
    8·1 answer
  • Which turn best describe news one is connected to the government and is used as a political tool more than as a business product
    12·1 answer
  • Cual es la importancia de aplicar los pasos en el modelo de diseño en las actividades académicas?
    14·1 answer
  • Which type of evaluation requires that the program be fully implemented before the evaluation can begin
    9·1 answer
  • Information about www
    14·1 answer
  • 5. Why do we need programming language?​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!