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
laila [671]
3 years ago
9

What is the output of the following code? public class Test { public static void main(String[] args) { String s1 = new String("J

ava"); String s2 = new String("Java"); System.out.print((s1 == s2) + " " + (s1.equals(s2))); } }
Computers and Technology
1 answer:
Darya [45]3 years ago
6 0

Answer:

false true

Explanation:

In the code snippet, two string objects are created in java with the value Java.

The print method first checks the condition s1==s2 and outputs false, This is so because the operator == which is used for equality in other primitive data types like ints cannot be applied to the String data type. In the second part of the print function, the equals function s1.equals(s2) is used and it prints true since the two string are equal

You might be interested in
What are the fundamental activities that are common to all software processes?
erica [24]

Answer:

There are some fundamental activities that are common to all software processes:

•Software specification. In this activity the functionality of the software and constraints on its operation must be defined.

•Software design and implementation. ...

•Software validation. ...

•Software evolution

7 0
3 years ago
Write a Python program string_functions.py that defines several functions. Each function re-implements Python's built-in string
Svetach [21]

Answer:

def length( mystring):

   count = 0

   for i in mystring:

       count += 1

   return count

def reversed( mystring):

   strlist = []

   for i in range(length(mystring)):

       strlist.append(mystring[(length(mystring) - 1) - i])

       txt = "".join(strlist)

   return txt

string = 'Yolanda'

print(reversed(string))

Explanation:

The python module defines two functions 'reversed' and 'length'. The length function counts the number of characters in a string variable while the reversed function reverses the string variable value.

3 0
3 years ago
460N of force is exerted on an object with a surface area of 2,5m.How much pressure is felt by the object?​
BartSMP [9]

Explanation:

p=F/A

p=460N/2m×5m

=46N/m2

7 0
3 years ago
Read 2 more answers
Tara needs to select all of the text in a Word document. Which keyboard shortcut will achieve this goal?
user100 [1]
Ctrl + a im pretty sure
3 0
4 years ago
Read 2 more answers
How Extreme Programming addresses Software Testing andevolution ?
kumpel [21]

Answer:

Extreme programming is a software development technique which is used to enhance software quality and it's response to ever changing customer requirements.

Testing

Testing is main focus in extreme programming.Extreme programming addresses testing in a way that if a minute testing can eliminate a bit of flaws, extensive testing can terminate a lot of flaws.

Evolution in Extreme programming is like this:-

Coding:-First programmers will code the problem.

Testing :- Testing is done to remove flaws.

Listening:- Programmers must listen to the customers to what they need.

Designing:-Then design according to the customer needs.

6 0
3 years ago
Other questions:
  • Which statement describes the word "iterative"?
    7·2 answers
  • Where is the insert function button found in microsoft excel?
    11·1 answer
  • Binary code what does this mean I was sick so I don't under stand
    7·2 answers
  • Why should you not perform any personal grooming task while driving?
    5·2 answers
  • What are the names of the two main characters in pirates of silicon valley
    5·1 answer
  • Using underlining and italics at the same time is which of these? A. allowed but might be overkill B. always a good idea C. not
    15·2 answers
  • What do you consider to be the next big thing in "Small Systems" (technology, hardware, software, etc.) and why?
    10·1 answer
  • marianne needs to create a version of her slide presentation that does not include all the slides and will be used for a particu
    9·1 answer
  • Find the max and min of a set of values using recursion Find the max and min of a set of values using recursion. First input the
    5·1 answer
  • Suppression of politically or socially unacceptable co
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!