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
andrew11 [14]
3 years ago
12

Suppose we have a String object called myString. Write a single line of Java code

Computers and Technology
1 answer:
VikaD [51]3 years ago
5 0

Answer:

myString=myString.toUpperCase();

Explanation:

In java to change all characters of a string to upper case we use .toUpperCase() method.It will convert string to upper case.

Implementation in java.

import java.util.*;

class Solution

{

public static void main (String[] args) throws java.lang.Exception

{

   try{

Scanner scr=new Scanner(System.in);

System.out.print("Enter a string:");

String myString=scr.nextLine();

myString=myString.toUpperCase();

System.out.println("string in upper case : "+myString);

         }catch(Exception ex){

       return;}

}

}

Output:

Enter a string:hello

string in upper case : HELLO

You might be interested in
Discuss some design considerations that you should keep in mind when you want to design a professional-looking flyer or newslett
iogann1982 [59]
Designs on business flyers should be based on the business' theme and the message that it wants to communicate. <span>A sale should have a design that would attract customers with the discounts they can avail with their purchases. </span><span>
</span>Texts, colors, lines, shapes, and images are the elements that should be figured out depending on the kind of communication that a business would want to share. <span>
</span><span>A sale flyer uses big text to emphasize discounts. Advertising products with amounts should require friendly designs with short and clear-cut messages. Colors can also drive customers and associate it with the kind of product. </span>
3 0
3 years ago
Here is a Test Code segment:
Tju [1.3M]
Here's the best answer I can give you, but bear with me.
The second option is incorrect because a class method must have a class identifier not an object identifier. What makes myObject an object identifier is the fact that it was created as an instance of the class MyClass in the constructor in line 5 (MyClass myObject= new MyClass(12.4,20);
The answer here should be MyClass.method2(20); Methods must have a set of parentheses, even if it has nothing inside. The first answer has a class identifier but the SOME_VALUE acts much like the Integer.MAX_VALUE; code which stores a constant value and does not actually perform tasks like most methods.
In short, the answer should be the last one but I hope my explanation cleared some things up for you, even if it was a bit more concept heavy than the question probably intended.
3 0
3 years ago
31. Explain what the program does. Write out the output 20 PRINT "Hellooo00000000000, world!" 30 PRINT "I'm learning about comma
inna [77]

o_num = input ("Please enter the amount of \"o\": ")

zero_num = input ("Please enter the amount of zeros: ")

i = 0

while i < o_num and i < zero_num:

repeat_o = "Hell" + o_num

repeat_zero = repeat_o + zero_num

i+=1

print (repeat_zero)

3 0
3 years ago
If you want to wrap text so that it fits a particular cell size, which formatting section would you use?
Pavlova-9 [17]

You would use the formatting section of alignment.

7 0
3 years ago
Read 2 more answers
Write the definition of a class Phone containing: 1. A data member named model of type string. 2. A data member named partNumber
Nady [450]

Answer:

class Phone(object):

   def __init__(self, model, partNumber, retailPrice):

       self.model = model

       self.part_number = partNumber

       self.retail_price = retailPrice

   def phone_specs(self):

       print( "Phone model: {}\nPart number: {}\nRetail price: {}".format( self.model, self.part_number, self.retail_price))

phone1 = Phone("Nokia", "asd234", 200.0)

phone1.phone_specs()

Explanation:

A class is a blueprint of a data structure used to create objects of the same data types and methods. The Phone class is an object that creates an instance of the phone1 object. The phone_specs method is used to display the details of the phone1 object.

4 0
3 years ago
Other questions:
  • Criminal Investigation people called my house on an automated voice is this a scam ??
    13·1 answer
  • Design an algorithm for a bounded-buffer monitor in which the buffers (portions) are embedded within the monitor itself."
    10·1 answer
  • Suppose your name was Alan Turing. Write a statement that would print your last name, followed by a comma, followed by a space a
    10·1 answer
  • ⭐️⭐️⭐️ what Network is larger in size? MAN or WAN? Thank you ⭐️⭐️⭐️
    5·1 answer
  • List at least three benefits of automated testing?
    13·1 answer
  • Write a paragraph on the following topic.
    14·1 answer
  • what are the benefits of VolP? select all that apply. A:cheaper printings B:clearer calls C: faster download D: increased effici
    11·2 answers
  • Which category does this fall in identity theft​
    6·1 answer
  • How does natural gas move through pipelines from the well head to the end user thousands of miles away
    5·1 answer
  • Halp me vanajsudhrbfhjrjfjfjf ​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!