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
NEED HELP
amid [387]

Answer:

i would do B

Explanation:

I YOUNGI

I MIDDLE I

I   AGED  I

I     MEH   I

I_______ I

\ kinda old/

  \ ____ /

   I OLD I

3 0
3 years ago
To the nearest​ millimeter, a cell phone is 7878 mm long and 3434 mm wide. What is the ratio of the width to the​ length?
Darina [25.2K]

Answer:

1:2

Explanation:

Width : Length

3434 : 7878

= 1 : 2.294

= 1 : 2 (to the nearest mm)

8 0
3 years ago
Default tab stops are set in Word every _______ inch. <br> A. ½<br> B. 1<br> C. ¼<br> D. ¾
Amanda [17]
In order to help the student expand his/her knowledge I will help answer the question. This in hope that the student will get a piece of knowledge that will help him/her through his/her homework or future tests.

Default tab stops are set every one half inch across a page. This is a default measure that Microsoft established. The correct answer is letter

A. 1/2

I hope it helps, Regards.     <span> </span>
4 0
4 years ago
You want to read about Web journals. which keywords would best help you find this information?
ololo11 [35]
The answer is (B) and (D) web or journal, <span>web Not journal


</span> Keyword is part of search engine optimization. Search engine optimization is not that heard. A keyword in a sentence is that significant word used to find info when doing your research.
Always, pick keywords that indicate main concepts of your topic. When searching, connect your keywords with Boolean values like AND, OR, and NOT





6 0
3 years ago
The Learning Journal is a tool for self-reflection on the learning process. The Learning Journal will be assessed by your instru
eimsori [14]
Any song recommendations u got for me? Thanks for the points!!!!
5 0
3 years ago
Other questions:
  • Computers store temporary Internet files in the Recycle Bin. These files take up space and slow down a computer. Which tool can
    10·1 answer
  • Show the stack with all activation record instances, including static and dynamic chains, when execution reaches position 1 in t
    14·1 answer
  • 3. Which one of the following statements is true for spell checkers?
    11·1 answer
  • Why are audio files compressed?
    12·1 answer
  • There are some processes that need to be executed. Amount of a load that process causes on a server that runs it, is being repre
    7·1 answer
  • Which of the following best describes the protocol used on the internet?
    8·1 answer
  • What are possible penalties if a designer is caught breaking copyright laws?
    13·1 answer
  • Which of the following statements are true about the code shown below in the class named Quiz? (Select all that apply.)
    7·1 answer
  • The math club starts with 5 members. Five months later, their membership has grown to 50 members.
    5·2 answers
  • Which of the following devices can be connected to a network? Check all of the boxes that apply.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!