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
Write a method called all Less that accepts two arrays of integers and returns true if each element in the first array is less t
GaryK [48]

Answer:

The program to this question can be given as:

Program:

#include<iostream> //header file

using namespace std; //using name space

bool allLess (int arr1[], int arr2[]) //defining method allLess  

{

int a,b; //define variable

a=  *(&arr1 + 1) - arr1; //hold length of arr1

b=  *(&arr2 + 1) - arr2; //hold length of arr2

if(a!=b) //checking condition  

{

return 1; //return value

}

for(int i=0; i<a; i++) //loop

{

if( arr1[i]>=arr2[i]) //checking condition

{

return 1; //return value

}

}

return 0; //return value

}

int main() //define main method.

{

   int arr1[]={1,2,3,4,5}; //define array arr1 and assign value.

   int arr2[]={4,5,6,7,8}; //define array arr2 and assign value.

   cout<< allLess(arr1,arr2); //function calling

   return 0;

}

Output:

1

Explanation:

The Explanation of the C++ language program can be given as follows:

  • In the above program firstly we include the header file. Then a method is defined that is "allLess" this method accepts two arrays that are "arr1 and arr2". This function returns a boolean value that is true or false.
  • Inside a function, we define a conditional statement and a loop in the if block we check the length of the arr1 array variable is not equal to arr2 array length. if this condition is true it will return false.
  • In the loop, we define another if block in this block we check that if arr1 array elements are grater then equal to arr2 array element if this condition is true it will return false. At the end of both if block and loop the function will return a value that is "true".
  • In the main method, we define two arrays and pass to the function and use (cout function) for print return value.
8 0
3 years ago
Sonic the Hedgehog (1991)
e-lub [12.9K]

Answer:

What if we made a fast game?

Explanation:

The mascot is the person, animal or thing which brings good luck, just like Mario. However, this is not a problem with Sonic the Hedgehog. And the Hedgehog is powerful enough to cross any barrier. Hence tieing the collectibles is not required. And the Hedgehog is quite cute and domestic. But it moves only 10 meters per second if we are considering the maximum speed. Hence, the correct option is certainly what if we made a fast game? And this is option C.

7 0
3 years ago
8.3 code practice edhesive PLEASE HELP AND HURRY
NemiM [27]

Answer:

numbers = '14 36 31 -2 11 -6'

nums = numbers.split(' ')

for i in range(0, len(nums)):

  nums[i] = int(nums[i])

print(nums)

8 0
2 years ago
Pleases Help ME An example of a _________________ impact is when a product is back ordered and the business contacts the custome
igomit [66]

Answer:

positive

Explanation:

it shows good customer service

8 0
3 years ago
what new technology led to the chaos that spurred the establishment of the federal communications commission?
adelina 88 [10]

Answer:

The digital read Harry quaant

3 0
1 year ago
Other questions:
  • You are running an application in Google App Engine that is serving production traffic. You want to deploy a risky but necessary
    9·1 answer
  • What is special about the f and j keys on a standard keyboard?
    15·2 answers
  • What is daemontools pakage in qmail?
    14·1 answer
  • The purpose of the ________ element is to describe the contents of a table.
    15·1 answer
  • ___ are controls through which a user can enter input data in a gui application. answer
    10·1 answer
  • Dylan, an interior designer, has sketched out a layout for a client's living room. He wants the client's approval of the layout
    11·2 answers
  • A star appears under the <br> menu of the word processing program.
    5·1 answer
  • Which type of market are you in if your firm, along with three other firms, controls 95% of the total music industry?
    13·1 answer
  • In the view that follows, which field can't be updated create view example_2 as select invoice_number, invoice_date, invoice_tot
    13·1 answer
  • If you do not specify any criteria in a delete query, Access will delete all the records in the table. Truth or False
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!