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
2. As you have learned, ironically, a large part of sound production involves visual perception. How easy or difficult did you f
Alex787 [66]

Answer: it is very easy to work with programs such as audacity, they are real game changers. Also, they are very helpful for editing and recording audio. They could make audacity’s auto tune more beginner friendly

3 0
2 years ago
Plsss help me<br>give two examples of problems that can occur when sytems do not work properly​
melomori [17]

Answer:

Explanation:

1. There can be a run out of something ex. The water cycle we could run out of water if evaporation stops happening

2. Something wont happen ex. In a shoe factory if no one is boxing the shoes the shoes don’t get boxed.

Hope this helps

6 0
3 years ago
Describe how implementation of a raid level 2 system would be beneficial to a university payroll system
lisabon 2012 [21]

<span>The RAID level 2 could give high information exchange rates and would be straightforward contrasted with other Raid levels. Be that as it may, it has a high cost and would need a high rate move required with a specific end goal to legitimize this cost.</span>

4 0
3 years ago
What are the four components of the Universal Systems Model?
kakasveta [241]

Answer:

output, process, input, and feedback

Explanation:

5 0
3 years ago
An array name is a pointer constant because the address stored in it cannot be changed during runtime.
choli [55]
The answer to your question would be option B- False
5 0
2 years ago
Read 2 more answers
Other questions:
  • What are the different between Facebook and LinkedIn
    15·2 answers
  • Your sister is considering purchasing a tablet computer that utilizes RT as the
    11·1 answer
  • When Mark’s organization implemented an IS, they faced the lack of confidence in users. Which strategy can improve user confiden
    11·1 answer
  • Write a MARIE program to calculate some basic statistics on a list of positive numbers. The program will ask users to input the
    6·1 answer
  • What will happen when you drag and drop a worksheet tab into another workbook WITHOUT holding the Ctrl key down?
    13·2 answers
  • Essay about evolution of media shaped the values and norms of the society
    11·1 answer
  • 8.2 Code Practice Edhesive
    6·1 answer
  • What should be entered to make the loop print
    6·1 answer
  • How do you fix this!!!!
    5·1 answer
  • The ___________ method returns the length of an array.
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!