Java METHODS and FUNCTIONS example part-2. Java tutorial and Basics for beginners #8.2

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

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

  • @Cowboy1Brian
    @Cowboy1Brian 6 лет назад +5

    This one took me a couple of times of watching it, stopping it, backing it up, listening to what you say and trying to put it all together. Then suddenly it was like a light came on. I am so appreciative of your style of teaching. Thank you so much!

    • @smartherd
      @smartherd  6 лет назад +1

      Thanks a lot. Do watch and comment on other videos as well.

    • @Cowboy1Brian
      @Cowboy1Brian 6 лет назад

      For some reason, today when I open this project in intellij, it is giving me an error ('; expected' '; expected' 'expression expected'). This is literally the same code I was playing with yesterday as I was following along with you on this video. When I was done for the night, I simply closed intellij. Now, I cant create ANY methods without getting this error. What am I doing wrong? Any ideas?
      The errors are appearing where I have marked with an '*'
      private static void myMethod*(*int num)*{
      if (num % 2 == 0)
      System.out.println(num + " is even");
      else
      System.out.println(num + " is odd");
      }

    • @smartherd
      @smartherd  6 лет назад +1

      Remove that *

    • @Cowboy1Brian
      @Cowboy1Brian 6 лет назад

      those "*'s" aren't in the actual code. In the above code, they indicate where I'm receiving those error messages. Here's a google doc with the code so you can copy and paste to see if you get the same error (if you wish), along with some screenshots showing you the actual error messages I'm referring to: docs.google.com/document/d/11lmN2tm2RRXUc8vHZ-VW7VkfVulpEu9NPmqZbofctbg/edit?usp=sharing

  • @BRENDAARTEAGA888
    @BRENDAARTEAGA888 5 лет назад +5

    I love that you’re very clear!
    I’ve taken Java in college but have forgotten how to write anything in Java. This is definitely bringing back what I previously learned.
    Thank you for the videos. You’re very good at explaining.
    Yes, I did stopped the video a couple of times to understand what you were explaining, but not because of you but because of me (my brain).
    You’re very good! You got me to subscribe :)

  • @sangeetakumar3857
    @sangeetakumar3857 7 лет назад +3

    I have watched several videos by you. I am preparing for upcoming interviews- These videos are helping me a lot to review the concepts and learn some new ones- in very less time :-). Thanks !!

  • @tuhinsatpati1127
    @tuhinsatpati1127 7 лет назад +1

    Man you are the best Java tutor... Love you

    • @smartherd
      @smartherd  7 лет назад

      +Think Techy thanks alot

  • @atomisten
    @atomisten 3 года назад

    ok why does this solution work at 7:15 ? string should only have 1 value. so after you run the isEven(num:4) then next time you run it, as isEven(num37) it should give an error since the isEven function uses the String str all the way through, so after it gets a value "is even" it should never change value to "odd" or anything, since it already took the string value of "4 is even".
    or is that somehow an exception too that when you write string somehow the java uses Stringbuffer? or does the parameter change from 4 to 37 creates a new instance of isEven where the new str is not the same object as the previous str?

  • @jaywantingle9405
    @jaywantingle9405 5 лет назад

    thanks bro, you are good at teaching and explaining concepts very simply

  • @boominathanarumugam5589
    @boominathanarumugam5589 6 лет назад

    You are a Great Teacher i easily understand several concepts

    • @smartherd
      @smartherd  6 лет назад

      Thank you. Keep. Commenting and like all videos. Support us

  • @kristiyanivanov7414
    @kristiyanivanov7414 4 года назад

    simply amazing, keep it up

  • @FidaHussain-nk6vm
    @FidaHussain-nk6vm 7 лет назад +1

    Very helpful bro,,,,ur method iz very simple and easy to understand.

    • @smartherd
      @smartherd  6 лет назад

      yo.. thansk for complements

  • @floraposteschild4184
    @floraposteschild4184 4 года назад

    Thank you for your very clear tutorials.
    Unfortunately, unless I'm missing something, the code at 5:02, lines 9 to 15 gives an error message. To work, there should be no num in brackets:
    isEven(4);
    isEven(5);
    isEven(6);
    isEven(11);

    • @swagnik6ix9ine
      @swagnik6ix9ine 3 года назад +1

      there is no num in bracket it's just the ide showing the programmer what it's pertaining to when the integer values are used

  • @sumitasi2462
    @sumitasi2462 4 года назад

    Arigato👌😊

  • @kevgi
    @kevgi 7 лет назад +1

    cool bro!!!

  • @nandinigorla
    @nandinigorla 5 лет назад

    Explain more examples in methods. I totally confused in this topic. Please explain sir....

  • @jashanpreetsingh8060
    @jashanpreetsingh8060 4 года назад

    Sir please tell if I can practise coding in my android phone... because I dont own any computer

    • @josephmejia5784
      @josephmejia5784 4 года назад

      Yes, I have an app called Java N-IDE, but I'm sure there are many others.

  • @didid3ksa
    @didid3ksa 5 лет назад

    plz sir help i write as you said in video and it didint work well
    code:-
    public class ss
    {
    public static void main(String[] args) {
    isEven( num: 4);
    }

    private static void isEven(int num) {
    if (num % 2 == 0)
    System.out.println(num +" is even");
    else
    System.out.println(num +" is odd");
    }
    }
    compilation error:-
    -syntax error in token : invalid assignment operator.
    -num cannot resolved to variable.
    //plz help me//

    • @GNandiniBCE
      @GNandiniBCE 5 лет назад

      You have to take the class Main and also you have to change that return type then u get output
      let's try Bhayya......

    • @someone4860
      @someone4860 4 года назад

      I think, today you have already become expert. don't you?

  • @johnwickgaming6938
    @johnwickgaming6938 5 лет назад

    Sir methods are 4 types
    1) no input,no output
    2) no input,output
    3)input,output
    4)input,no output
    Plzz make video on this concept if u can

  • @arslankhan1276
    @arslankhan1276 4 года назад

    sir there is problem not showing output

  • @uttampal5295
    @uttampal5295 6 лет назад

    I guess you have taught core java on internshala right?

  • @ajithk2183
    @ajithk2183 4 года назад

    Please explain "return type"

    • @ajithk2183
      @ajithk2183 4 года назад

      Concept of return type please....

  • @GNandiniBCE
    @GNandiniBCE 5 лет назад

    can you explain few more examples in methods? I am not sure about this topic where I have to write code and where I have to return.please explain sir......thank you