Throw And Throws In Java Tutorial #48

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 พ.ย. 2024

ความคิดเห็น • 87

  • @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 10 หลายเดือนก่อน +3

      Are you making new videos or all finished??

  • @creativeshakeeb7996
    @creativeshakeeb7996 5 หลายเดือนก่อน +30

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

  • @ophix6951
    @ophix6951 7 หลายเดือนก่อน +5

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

  • @cxsey8587
    @cxsey8587 ปีที่แล้ว +18

    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 5 หลายเดือนก่อน

      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 5 หลายเดือนก่อน

      @@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.

  • @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 ปีที่แล้ว +4

    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 TH-cam channel. I hope you continue posting your amazing videos, maybe some Java web application projects. Love!

  • @khanhgiapham-mi4hg
    @khanhgiapham-mi4hg ปีที่แล้ว +8

    Very nice video. Carry on the good work sir.

  • @frufrumeep
    @frufrumeep ปีที่แล้ว +3

    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!!!

  • @aryankushwaha9306
    @aryankushwaha9306 9 หลายเดือนก่อน +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.♥♥

  • @firepluto6128
    @firepluto6128 8 หลายเดือนก่อน

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

  • @Arfifias
    @Arfifias 11 หลายเดือนก่อน

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

  • @ravitejaedibilli9470
    @ravitejaedibilli9470 ปีที่แล้ว

    The best channel for java in TH-cam▶️

  • @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🙂👍

  • @jusrene
    @jusrene 8 หลายเดือนก่อน

    Best programmer ever! thx alex 💗

  • @ridima7851
    @ridima7851 ปีที่แล้ว

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

  • @aly9165
    @aly9165 6 หลายเดือนก่อน +4

    i miss u alex lee

    • @mahdikhairddine
      @mahdikhairddine 5 หลายเดือนก่อน

      He is a political figure now

  • @ShuddhoDevDhali-xc4pv
    @ShuddhoDevDhali-xc4pv 6 หลายเดือนก่อน +2

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

  • @Sijo2
    @Sijo2 10 หลายเดือนก่อน

    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?

  • @adrianlocquiao4865
    @adrianlocquiao4865 ปีที่แล้ว +1

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

  • @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🙏

  • @huynguyenthieu7474
    @huynguyenthieu7474 17 วันที่ผ่านมา

    Love your video! Thank you.

  • @mahdikhairddine
    @mahdikhairddine 5 หลายเดือนก่อน +1

    Weeeee need you comeee backkk

  • @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

  • @amoghnigam8311
    @amoghnigam8311 10 หลายเดือนก่อน +1

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

  • @Sw66pty
    @Sw66pty 2 หลายเดือนก่อน

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

  • @E2006-z6m
    @E2006-z6m ปีที่แล้ว

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

  • @ophix6951
    @ophix6951 7 หลายเดือนก่อน

    I LOVE UR NEW KEYBOARD ITS ADORABLE 🥹

  • @kcsiddhartha
    @kcsiddhartha 10 หลายเดือนก่อน +1

    Wait is he back?

  • @carol00210
    @carol00210 ปีที่แล้ว

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

  • @retrovoid75
    @retrovoid75 4 หลายเดือนก่อน

    Can you make a video about StringBuilders plz :)

  • @poorpanda9033
    @poorpanda9033 ปีที่แล้ว

    Was waiting for this thank youuuu ❤🎉

  • @oshadhaedirisinghe1455
    @oshadhaedirisinghe1455 10 หลายเดือนก่อน

    Thank you

  • @tribs-07
    @tribs-07 ปีที่แล้ว

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

  • @abdulmalik-mahmoud
    @abdulmalik-mahmoud 4 หลายเดือนก่อน

    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!

  • @justyourlocalprogrammer
    @justyourlocalprogrammer ปีที่แล้ว

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

  • @osamabinlagging36ty99
    @osamabinlagging36ty99 ปีที่แล้ว +1

    Make video on File, iostream and generics too

  • @melitaslashpromise239
    @melitaslashpromise239 2 หลายเดือนก่อน

    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 ?🙏

  • @aryankushwaha9306
    @aryankushwaha9306 8 หลายเดือนก่อน

    please upload more videos

  • @kumuthusandeepa8045
    @kumuthusandeepa8045 ปีที่แล้ว

    nice Explanation sir

  • @pranavnikam5922
    @pranavnikam5922 ปีที่แล้ว

    Thank you Alex😊

  • @dcamcan
    @dcamcan ปีที่แล้ว

    Love the keyboard!

  • @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?

  • @Jackolantirn
    @Jackolantirn ปีที่แล้ว

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

  • @salamibraheem3728
    @salamibraheem3728 ปีที่แล้ว

    Thank you Alex

  • @jerryjerryjerry1
    @jerryjerryjerry1 ปีที่แล้ว +2

    please use dark mode, my eyes are burning

  • @Agent-jh6hq
    @Agent-jh6hq หลายเดือนก่อน

    do any of your course is on udemy ?

  • @dianaalmanza524
    @dianaalmanza524 ปีที่แล้ว

    what keyboard is that?? so nice

  • @vivvv-dinonugs
    @vivvv-dinonugs ปีที่แล้ว

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

  • @cry4025
    @cry4025 ปีที่แล้ว

    Do you think you could go over comparable and comparator?

  • @glasses4180
    @glasses4180 ปีที่แล้ว

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

  • @onlyzombiees7931
    @onlyzombiees7931 9 หลายเดือนก่อน

    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!?

  • @lofo_
    @lofo_ 11 หลายเดือนก่อน

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

  • @JehanSaren
    @JehanSaren ปีที่แล้ว

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

  • @gamewiz1079
    @gamewiz1079 ปีที่แล้ว

    Can you give us a junit and mockito tutorial

  • @pravithrav7596
    @pravithrav7596 7 หลายเดือนก่อน

    Can you make collections and spring spring boot java vedios please

  • @Firestar0910
    @Firestar0910 11 หลายเดือนก่อน

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

  • @golden5976
    @golden5976 ปีที่แล้ว

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

  • @keirgordon8646
    @keirgordon8646 ปีที่แล้ว

    nice keyboard

  • @Shelby_itachi
    @Shelby_itachi ปีที่แล้ว

    Java king 🤴 🙌

  • @kotlinnn
    @kotlinnn 8 หลายเดือนก่อน +1

    you should leetcode problems

  • @xomnionProgrammingAndChess
    @xomnionProgrammingAndChess ปีที่แล้ว +1

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

  • @OKrazianth
    @OKrazianth 9 หลายเดือนก่อน

    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 9 หลายเดือนก่อน

    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 9 หลายเดือนก่อน

    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 9 หลายเดือนก่อน

    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 9 หลายเดือนก่อน

      Mago

    • @OKrazianth
      @OKrazianth 9 หลายเดือนก่อน

      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 8 หลายเดือนก่อน

    Alex, do you have instagram?