Throw And Throws In Java Tutorial #48

Поделиться
HTML-код
  • Опубликовано: 9 янв 2025

Комментарии •

  • @alexlorenlee
    @alexlorenlee  Год назад +10

    If you’re new to programming but want a career in tech, I HIGHLY RECOMMEND applying to one of Springboard’s online coding bootcamps (use code ALEXLEE for $1,000 off): bit.ly/3HX970h

    • @javedsultan4830
      @javedsultan4830 11 месяцев назад +3

      Are you making new videos or all finished??

  • @creativeshakeeb7996
    @creativeshakeeb7996 7 месяцев назад +38

    your video is being used in my university to teach us.

  • @cxsey8587
    @cxsey8587 Год назад +19

    These videos kept me in computer science, you made Objects make sense to me. Couldn’t understand them my whole sophomore year until I watched your videos. Very happy you’re making videos again to help people that are in the same situation as I was again.

    • @yur4953
      @yur4953 7 месяцев назад

      Hey what advice would you give to a person who’s almost giving up on Cs😔 I’m currently in my second Semester and this is really tough

    • @cxsey8587
      @cxsey8587 7 месяцев назад

      @@yur4953 figure out why you’re in CS, it’s important. If you can’t find passion or interest that drives you, you’re going to struggle. Rn especially with how tight the market is. An average candidate is someone with internships, projects, and an understanding of the concepts. If you’re not willing to try and be better than average, there’s thousands more out there who will.

  • @ophix6951
    @ophix6951 9 месяцев назад +6

    I’ve felt like giving up so many times but ur videos motivate me to push on, so thank u ❤️

  • @moreliasosa2358
    @moreliasosa2358 Год назад +9

    I wouldn't have graduated from college if it wasn't for your videos! Thank you for all you help! 💛💛

    • @elishaokello
      @elishaokello Год назад +4

      This dude is great, I am a newbie in Java and he has really helped me

    • @elishaokello
      @elishaokello Год назад

      Are you currently working with an IT firm?

  • @fredhutchinson5256
    @fredhutchinson5256 Год назад +5

    Alex, I rarely write comment on any video, however your videos are amazing, you are explaining the Java concepts in the simplest way in whole world :) I appreciate your efforts and thank you very much for such a resourceful RUclips channel. I hope you continue posting your amazing videos, maybe some Java web application projects. Love!

  • @frufrumeep
    @frufrumeep Год назад +4

    you're still making videos?? I just learned about you and recently watched your "I'm not doing java videos anymore videos." Didn't check the date though. I'm an adult learner in my second programming class and it is a huge struggle. I'm looking forward to binging your videos to learn, thank you!!!

  • @khanhgiapham-mi4hg
    @khanhgiapham-mi4hg Год назад +8

    Very nice video. Carry on the good work sir.

  • @ravitejaedibilli9470
    @ravitejaedibilli9470 Год назад

    The best channel for java in RUclips▶️

  • @aryankushwaha9306
    @aryankushwaha9306 10 месяцев назад +5

    Hey, Alex I am aryan kushwaha from India, I just want to tell you that you should have to make some real project-based video just like you made on tick tac toe but something in advance so that it helps us to learn more. can you plz make videos on Java projects for beginners it helps us a lot to understand Java This is a huge request. and love from India.♥♥

  • @Arfifias
    @Arfifias Год назад

    Thank you alex for teaching me java you made me a better developer

  • @ridima7851
    @ridima7851 Год назад

    thankyou so much , this helped me a lot for preparing for my school exam !!!

  • @firepluto6128
    @firepluto6128 10 месяцев назад

    Hey Alex please make springboot playlist
    It would be great
    Your teaching style is superb

  • @merrilystudy6642
    @merrilystudy6642 Год назад

    @alexlorenlee In case of ArrayIndexOutOfBoundsException we didn't needed to add throws in arrayPractice method is because ArrayIndexOutOfBoundsException is an Unchecked exception. That means, compiler doesn't force you to handle it using throws or try catch.
    In case of Exception class, Exception class itself is a checked exception. Hence when you used throw new Exception, it made it mandatory for you to handle it using throws Exception in arrayPractice method and further using try catch block in main method or by throws in main method.
    Also wanted to let you know that your videos are simple and helpful🙂👍

  • @ssentongohenryatanus4917
    @ssentongohenryatanus4917 Месяц назад

    You simplified my java classes both in the first year, where are you now??

  • @JehanSaren
    @JehanSaren Год назад

    The things you teach are good, Sir, where you can quickly understand because it is direct to the point. I didn't go to a programming in college but I'm just learning on my own. I hope you can also make a tutorial on how to make an physics engine.Please🙏

  • @jusrene
    @jusrene 10 месяцев назад

    Best programmer ever! thx alex 💗

  • @aly9165
    @aly9165 8 месяцев назад +4

    i miss u alex lee

  • @adrianlocquiao4865
    @adrianlocquiao4865 Год назад +1

    Hi Alex! Thanks for the throw/throws vid 🙏🙏😀

  • @outpyked2733
    @outpyked2733 Год назад

    Hey Alex!
    I have a request to make for the whole Java Series you have. It could be helpful to 1. make the playlists again (theyre all bunched up into one big one now) 2. maybe make a little task for each of the series? That takes all the things from the basics course and combines it into a project to work on. With a little stopper saying: "okay now do it yourself" and right after resuming the video you have the answer?
    Does that make sense?
    I just love you videos man

  • @abdulmalik-mahmoud
    @abdulmalik-mahmoud 6 месяцев назад

    Suggestion 7:45:
    index should be greater than 5 or equal, as the array size is 5, and you know the array is 0-indexed, so the 5th index is unreachable!

  • @huynguyenthieu7474
    @huynguyenthieu7474 2 месяца назад

    Love your video! Thank you.

  • @ShuddhoDevDhali-xc4pv
    @ShuddhoDevDhali-xc4pv 8 месяцев назад +2

    BRO COME BACK MAN, I MISS YOUR TUTORIALS, ITS BEEN 9 MONTHS NOW

  • @Sijo2
    @Sijo2 11 месяцев назад

    Hi, Alex. I really enjoy your channel and content. I am currently going to a coding bootcamp and i want to know what is a typical day like as a coder. I enjoy coding and find it fun , but sometimes challenging. I know there is a bunch of youtuber film their daily code life but they really don't tell us what they do. Is it possible you could make a video about what you do and what a typical day would be like?

  • @poorpanda9033
    @poorpanda9033 Год назад

    Was waiting for this thank youuuu ❤🎉

  • @amoghnigam8311
    @amoghnigam8311 11 месяцев назад +1

    can u create the video for printing series through java loop day after tom is my exam ? can u plz sir?

  • @mahdikhairddine
    @mahdikhairddine 7 месяцев назад +1

    Weeeee need you comeee backkk

  • @E2006-z6m
    @E2006-z6m Год назад

    Can you make more videos you helped me get an a+ on my CS tests

  • @ophix6951
    @ophix6951 9 месяцев назад

    I LOVE UR NEW KEYBOARD ITS ADORABLE 🥹

  • @Sw66pty
    @Sw66pty 4 месяца назад

    When you coming back to youtube man? how you been lately? Miss your videos!

  • @pranavnikam5922
    @pranavnikam5922 Год назад

    Thank you Alex😊

  • @melitaslashpromise239
    @melitaslashpromise239 4 месяца назад

    Hey Alex, I want create a code about a Restaurant having three different foods for their customers based on the time the user walks in. For example having food like jellof rice and chicken from 8am-12pm, then fried rice from 12:30pm-3pm and then swallow from 3:30pm-10pm. Please how do I declare time on Java and run it as a code ?🙏

  • @tribs-07
    @tribs-07 Год назад

    hello alex i just visit your channel so sorry for late quite busy lately.❤

  • @dcamcan
    @dcamcan Год назад

    Love the keyboard!

  • @justyourlocalprogrammer
    @justyourlocalprogrammer Год назад

    Are you going to make a Video on Bubble and Insertion Sort?

  • @retrovoid75
    @retrovoid75 5 месяцев назад

    Can you make a video about StringBuilders plz :)

  • @onlyzombiees7931
    @onlyzombiees7931 11 месяцев назад

    Why did it prompt for add throws exception while you were throwing throw new arrayindexout of bound exception
    But it was asking you to explicitly add throws Exception to the method when you canged from through new aiob exception to throw new exception!?

  • @salamibraheem3728
    @salamibraheem3728 Год назад

    Thank you Alex

  • @kumuthusandeepa8045
    @kumuthusandeepa8045 Год назад

    nice Explanation sir

  • @Agent-jh6hq
    @Agent-jh6hq 3 месяца назад

    do any of your course is on udemy ?

  • @JehanSaren
    @JehanSaren Год назад

    Hi sir alex, how to initialize the array without typing value manually but by using for loop?😢

  • @carol00210
    @carol00210 Год назад

    Hey, could you make a video about Threads? :)

  • @cry4025
    @cry4025 Год назад

    Do you think you could go over comparable and comparator?

  • @Jackolantirn
    @Jackolantirn Год назад

    What is this program he is using to create these new java projects? It looks so sick

  • @lofo_
    @lofo_ Год назад

    hi do you know any good websites to practice what I have learned

  • @dianaalmanza524
    @dianaalmanza524 Год назад

    what keyboard is that?? so nice

  • @oshadhaedirisinghe1455
    @oshadhaedirisinghe1455 11 месяцев назад

    Thank you

  • @kcsiddhartha
    @kcsiddhartha 11 месяцев назад +1

    Wait is he back?

  • @vivvv-dinonugs
    @vivvv-dinonugs Год назад

    Please make a video about bit manipulation and bitwise operators in java!!!!

  • @osamabinlagging36ty99
    @osamabinlagging36ty99 Год назад +1

    Make video on File, iostream and generics too

  • @jerryjerryjerry1
    @jerryjerryjerry1 Год назад +2

    please use dark mode, my eyes are burning

  • @elishaokello
    @elishaokello Год назад

    Hey Alex and Java lovers, are there projects that one can do to make him or her perfect and sharpen his skills in java?

  • @Shelby_itachi
    @Shelby_itachi Год назад

    Java king 🤴 🙌

  • @gamewiz1079
    @gamewiz1079 Год назад

    Can you give us a junit and mockito tutorial

  • @aryankushwaha9306
    @aryankushwaha9306 10 месяцев назад

    please upload more videos

  • @pravithrav7596
    @pravithrav7596 9 месяцев назад

    Can you make collections and spring spring boot java vedios please

  • @glasses4180
    @glasses4180 Год назад

    Wait you returned on making tutorials? I thought we lost you.

  • @Firestar0910
    @Firestar0910 Год назад

    Here we are don't turn away now!!!

  • @keirgordon8646
    @keirgordon8646 Год назад

    nice keyboard

  • @xomnionProgrammingAndChess
    @xomnionProgrammingAndChess Год назад +1

    Okay, I mean, I loved your tutorial, but the title is a tongue twister lol

  • @kotlinnn
    @kotlinnn 10 месяцев назад +1

    you should leetcode problems

  • @golden5976
    @golden5976 Год назад

    Do you make good money? I hope you do thank you

  • @OKrazianth
    @OKrazianth 11 месяцев назад

    import java.util.Scanner;
    public class TwoHalves {
    public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    while (true) {
    System.out.println("Enter a string (type 'exit' to quit):");
    String input = scanner.nextLine();
    if (input.equalsIgnoreCase("exit")) {
    break;
    }
    printTwoHalves(input);
    }
    scanner.close();
    }
    private static void printTwoHalves(String input) {
    System.out.println("Original string: " + input);
    System.out.println("(" + input.length() + " letters - " + (input.length() % 2 == 0 ? "Even" : "Odd") + ")");
    if (input.length() % 2 == 0) {
    String firstHalf = input.substring(0, input.length() / 2);
    String secondHalf = input.substring(input.length() / 2);
    System.out.println("= loveUTOO" + firstHalf);
    System.out.println("= love" + secondHalf);
    System.out.println("= Utoo" + firstHalf.toUpperCase());
    System.out.println("Original string");
    System.out.print("1st half: " + firstHalf);
    System.out.println();
    System.out.print("2nd half: " + secondHalf);
    System.out.println();
    if (firstHalf.equals(secondHalf)) {
    System.out.println("2 halves are the same");
    } else {
    System.out.println("2 halves are not the same");
    }
    } else {
    System.out.println("(Odd number of letters - cannot be split evenly)");
    }
    System.out.println("------------------------------");
    }
    }

  • @RAZIANTHKEARSEBATILLERCAÑA
    @RAZIANTHKEARSEBATILLERCAÑA 10 месяцев назад

    import java.util.Scanner;
    public class Quiz2 {
    public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    System.out.print("Enter a 5 letter string: ");
    String input = scanner.nextLine();
    if (input.length() != 5) {
    System.out.println("Error: Please enter a 5-letter string.");
    return;
    }
    StringBuilder manipulatedString = new StringBuilder();
    manipulatedString.append(input.charAt(4));
    manipulatedString.append("-");
    manipulatedString.append(input.charAt(1));
    manipulatedString.append(input.charAt(2));
    manipulatedString.append(input.charAt(3));
    manipulatedString.append("-");
    manipulatedString.append(input.charAt(0));
    System.out.println(manipulatedString.toString());
    }
    }

  • @RAZIANTHKEARSEBATILLERCAÑA
    @RAZIANTHKEARSEBATILLERCAÑA 10 месяцев назад

    import java.util.Scanner;
    public class Quiz3 {
    public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    while (true) {
    System.out.print("Enter a string: ");
    String input = scanner.nextLine();
    if (input.equalsIgnoreCase("quit")) {
    break;
    }
    analyzeString(input);
    }
    System.out.println("Goodbye!");
    }
    private static void analyzeString(String input) {
    if (input.length() < 2) {
    System.out.println("Result: Too short.");
    return;
    }
    System.out.println("Result:");
    System.out.println("Original String: " + input);
    boolean isEven = input.length() % 2 == 0;
    StringBuilder firstHalf = new StringBuilder();
    StringBuilder secondHalf = new StringBuilder();
    if (isEven) {
    int halfLength = input.length() / 2;
    firstHalf.append(input, 0, halfLength);
    secondHalf.append(input, halfLength, input.length());
    System.out.println("1st half: " + firstHalf);
    System.out.println("2nd half: " + secondHalf);
    System.out.println("2 halves are the same: " + firstHalf.toString().equals(secondHalf.toString()));
    if (firstHalf.toString().equals(secondHalf.toString())) {
    System.out.println("= " + modifyString(firstHalf.toString()));
    } else {
    System.out.println("= " + modifyString(firstHalf.toString()) + " " + modifyString(secondHalf.toString()));
    }
    } else {
    int halfLength = input.length() / 2;
    firstHalf.append(input, 0, halfLength);
    secondHalf.append(input, halfLength + 1, input.length());
    System.out.println("1st half: " + firstHalf);
    System.out.println("2nd half: " + secondHalf);
    System.out.println("2 halves are the same: " + firstHalf.toString().equals(secondHalf.toString()));
    System.out.println("|--|--");
    }
    System.out.println("(" + input.length() + " letters " + (isEven ? "Even" : "Odd") + ")");
    }
    private static String modifyString(String input) {
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < input.length(); i++) {
    if (i == 0) {
    sb.append(Character.toUpperCase(input.charAt(i)));
    } else {
    sb.append(input.charAt(i));
    }
    }
    sb.append("oO");
    return sb.toString();
    }
    }

  • @OKrazianth
    @OKrazianth 11 месяцев назад

    import java.util.Scanner;
    public class TwoHalves {
    public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    while (true) {
    System.out.println("Enter a string (type 'exit' to quit):");
    String input = scanner.nextLine();
    if (input.equalsIgnoreCase("exit")) {
    break;
    }
    printTwoHalves(input);
    }
    scanner.close();
    }
    private static void printTwoHalves(String input) {
    System.out.println("Original string: " + input);
    if (input.length() % 2 == 0) {
    String firstHalf = input.substring(0, input.length() / 2);
    String secondHalf = input.substring(input.length() / 2);
    System.out.println("1st half: " + firstHalf);
    System.out.println("2nd half: " + secondHalf);
    if (firstHalf.equals(secondHalf)) {
    System.out.println("2 halves are the same");
    } else {
    System.out.println("2 halves are not the same");
    }
    } else {
    System.out.println("(Odd number of letters - cannot be split evenly)");
    }
    System.out.println("---");
    }
    }

    • @OKrazianth
      @OKrazianth 11 месяцев назад

      Mago

    • @OKrazianth
      @OKrazianth 11 месяцев назад

      import java.util.Scanner;
      public class TwoHalves {
      public static void main(String[] args) {
      Scanner scanner = new Scanner(System.in);
      while (true) {
      System.out.println("Enter a string (type 'exit' to quit):");
      String input = scanner.nextLine();
      if (input.equalsIgnoreCase("exit")) {
      break;
      }
      printTwoHalves(input);
      }
      scanner.close();
      }
      private static void printTwoHalves(String input) {
      System.out.println("Original string: " + input);
      System.out.println("(" + input.length() + " letters - " + (input.length() % 2 == 0 ? "Even" : "Odd") + ")");
      if (input.length() % 2 == 0) {
      String firstHalf = input.substring(0, input.length() / 2);
      String secondHalf = input.substring(input.length() / 2);
      System.out.println("= loveUTOO" + firstHalf);
      System.out.println("= love" + secondHalf);
      System.out.println("= Utoo" + firstHalf.toUpperCase());
      System.out.println("Original string");
      System.out.print("1st half: " + firstHalf);
      System.out.println();
      System.out.print("2nd half: " + secondHalf);
      System.out.println();
      if (firstHalf.equals(secondHalf)) {
      System.out.println("2 halves are the same");
      } else {
      System.out.println("2 halves are not the same");
      }
      } else {
      System.out.println("(Odd number of letters - cannot be split evenly)");
      }
      System.out.println("------------------------------");
      }
      }

  • @kaylo.101
    @kaylo.101 9 месяцев назад

    Alex, do you have instagram?