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
How dependent are we on technology? ​
rusak2 [61]

very independent  : ) we use it for everything

3 0
3 years ago
Read 2 more answers
Look at the picture lol
andrey2020 [161]

Answer:

Zoom in more please and than i can help

Explanation:

6 0
3 years ago
Read 2 more answers
Can someone help me with Edhesive 8.3 lesson practice question number 5? I can’t figure it out
Galina-37 [17]

Answer:

3

Explanation:

4 0
3 years ago
Is science fiction always set in the future
Natali5045456 [20]
Yes and No it all depends on how the author wants the poem how to be and become. Majority of the time science fiction is set for the future.
5 0
3 years ago
The ________ maps the software architecture created in design to a physical system architecture that executes it. (Points : 3) a
VARVARA [1.3K]

Answer:Deployment diagram

Explanation: Deployment diagram is the diagram that is used for displaying the hardware parts upon which the software architecture works.The main purpose of the diagram is showing the function and operations taking place through the deployment of the software system with the hardware.

These diagrams are made up of the nodes , interface, artifacts and other components. Other given options are incorrect because architectural diagram is for designing of the architecture of a system,sequence diagram is used for the sequential order display of system components and  state chart diagram is the diagram that shows the status of the parts of the operating system.

Therefore, the correct option is deployment diagram.

8 0
3 years ago
Other questions:
  • How useful is the creation of folders for your computer
    9·1 answer
  • Identify the six components of an information system. Which are most directly affected by the study of computer security? Which
    8·1 answer
  • Write a program that asks the user for three strings. Then, print out whether the first string concatenated to the second string
    8·1 answer
  • Describe five different ways databases can be processed
    14·1 answer
  • Which of the following electronic payments is ideal for micropayments?
    11·2 answers
  • Open the NetBeans IDE and create a new project named MySizes.java. Your program should do the following:
    9·1 answer
  • ____ Is an Internet service that allows users to send and receive short text messages In real time.
    10·1 answer
  • write the definition of a class clock. the class has no constructors and one instance variable of type int called hours.
    12·1 answer
  • How is distributed ledger technology (DLT) used in a blockchain?
    8·1 answer
  • The advantage of using a spreadsheet is:
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!