Advertisement
KodingKid

Java StringtoUpperCase and addExclamationPoint

May 18th, 2021
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. public class MyJava { //create the class
  2.     public static void main(String[] args) { //start the script
  3.         String sentence = "I learnt this script from watching a 10-minute video lol"; //a string
  4.         System.out.println(sentence.toUpperCase()); //prints I LEARNT THIS SCRIPT FROM WATCHING A 10-MINUTE VIDEO LOL
  5.     }
  6.     public static void addExclamationPoint(String sentence) { //create the method
  7.         System.out.println(sentence + "!") //prints I LEARNT THIS SCRIPT FROM WATCHING A 10-MINUTE VIDEO LOL!
  8.         }
  9. } //ends the script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement