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]
4 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]4 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
The purpose of the ________ element is to describe the contents of a table.
Korolek [52]
<caption> element.

It is used to add a caption to a HTML table. With CSS, it may be positioned right at the bottom of the table but in HTML, it must appear as the 1st descendant of a parent <table>. Note that you can specify only one caption in a single table.






4 0
3 years ago
Businesses around the world all need access to the same data, so there
Alexxx [7]

Answer:

B

Explanation:

3 0
2 years ago
PLEASE I NEED HELP, WILL MARK BRAINLYEST!!! 50 POINTS!!!
Effectus [21]

Answer: Develop the structure of the screenplay

Explanation:

The screenplay helps the team find the character of the film and develop it.

8 0
3 years ago
How do you understand a scientific problem? Give two (2) examples of a scientific problem you
Brums [2.3K]

Answer:

i need free points im sry

Explanation:

8 0
3 years ago
What is the value of this expression:<br> ‘there' == 'here'
d1i1m1o1n [39]

Answer: undefined

Explanation:

just gonna answer it instead of it being a comment

8 0
2 years ago
Other questions:
  • Select the correct answer.
    8·1 answer
  • The first thing to do when your computer gives you a error message is
    7·2 answers
  • What happens if you never confirm your facebook account?
    8·1 answer
  • Modify your solution to Problem 8.24 so that one (and only one) child installs a Segmentation-fault handler which prints an erro
    10·1 answer
  • True false) cad means computer aided manufacturing​
    10·1 answer
  • List three ways security could be improved for taking the prepared deposit monies to the bank?​
    11·1 answer
  • Sally is editing her science report about living things. She needs to copy a paragraph from her original report.
    13·1 answer
  • Genres are useful for many reaseons. What are some explanations you can think of for how genres can be useful to players, game d
    10·1 answer
  • How is unqualified assumptions a disadvantage of communication​
    14·1 answer
  • Is anyone excited for the new matrix coming out ?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!