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
sleet_krkn [62]
3 years ago
12

Write a static boolean method named beginsWithZ. It should accept a String object as a parameter. It should return true if the f

irst character in the String is either of two characters: a capital ‘Z’, or a lowercase ‘z’. (Note: Check the parameter for a null value, and for an empty string. Nulls and empty strings do not start with an ‘z’.)
Computers and Technology
1 answer:
almond37 [142]3 years ago
6 0

Answer:

public static boolean beginsWithZ(String word){

if(string == null || string.length() == 0)

return 0;

if(word.charAt(0) == 'Z' || word.charAt(0) == 'z')

return 1;

else

return 0;

}

Explanation:

This method is a boolean method, meaning it returns true if the string begins with Z or z and false otherwise. So:

The Java command charAt() let's you find the character at each position of the string, so i use it.

public static boolean beginsWithZ(String word){

if(string == null || string.length() == 0)

return 0;

if(word.charAt(0) == 'Z' || word.charAt(0) == 'z')

return 1;

else

return 0;

}

You might be interested in
A ___________ is the smallest unit in a written language.
Delvig [45]
A. string? maybee its a string of units


8 0
3 years ago
Read 2 more answers
List and describe three options in the autocad object snap toolbar
miv72 [106K]
<span>END POINT : Snaps to the closest endpoint or corner of a geometric object. MID POINT : Snaps to the midpoint of a geometric object. CENTER : Snaps to the center of an arc, circle, ellipse, or elliptical arc.</span>
6 0
3 years ago
Why is it important to cite your sources?
emmainna [20.7K]

Answer:

It gives credit to the original author and shows that you are not taking credit for someone

else's work

7 0
3 years ago
Read 2 more answers
Which one of the following downloads and uploads files to and from a server? A. Client B. Internet protocol C. Server D. Worksta
earnstyle [38]
The answer is A. Client request and receive files to and from a server.
5 0
3 years ago
Before you can use the Management Studio to work with the objects in a database, you must ___________ the database files (i.e.,
Lelu [443]

Answer:

You must attach the database files

Explanation:

4 0
3 years ago
Other questions:
  • If using the md5 hashing algorithm, what is the length to which each message is padded?
    11·1 answer
  • Gemima wants to show the amount of vitamin C a fruit salad contains in the blue cell of the table below. To do this, she needs t
    9·2 answers
  • Would these statements cause an error? Why or why not? int year = 2019; int yearNext = 2020; int &amp; ref = year; &amp; ref = y
    7·1 answer
  • who will follow me on tiktok and like all my videos? if you do ill give branlist and give u a shoutout and you can enter my big
    15·1 answer
  • Select the correct answer.
    10·1 answer
  • I need to change the subject before they get onto me. I am only revealing info today if you are a friend.
    5·1 answer
  • Will give brainly if answer all or my questions
    8·1 answer
  • Which element is represented by the electron configuration in example B? Example B: 1s22s22p63s23p64s1 Aluminum Cesium Potassium
    12·2 answers
  • When right-clicking an object, a ____ menu appears, which contains frequently used commands related to the object.
    7·1 answer
  • What actions might contribute to recommendations you see online?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!