Java Video Tutorial 5

preview_player
Показать описание


Here I continue my Java Video Tutorial by covering methods, or functions in Java.

I spend a considerable amount of time on those things that tend to confuse people who are learning Java. I review how class variables differ from local variables and provide numerous examples of methods.
Рекомендации по теме
Комментарии
Автор

I love when you affirm that a certain concept will definitely be explained later, somehow helps not to box that thought up and put it away.
Really good for the audience to ensure you retain the information.
Great job, you are a blessing

Ali-miup
Автор

You are right. The return sends back the answer of the calculation back to the part of the program that asked for it

derekbanas
Автор

I'm just happy that you are watching them. Most people don't know I exist. I have about 90 Java tutorials done so far and many more are coming. If you want to learn software design I'm just finishing design patterns. Then I'll cover UML, OOP principles, refactoring and algorithms. It's pretty much everything you learn when you get a CS degree

derekbanas
Автор

I'm very happy that I was able to help :) We all learn in different ways. I like you learn better at a quick pace. That is why I make these tutorials differently from all the rest. Always feel free to ask questions. I do my best to help

derekbanas
Автор

Thank you very much for the kind message :) I'll continue to try and do my best. Many more tutorials are planned for the future

derekbanas
Автор

Thank you :) I'm glad you liked them. I'm up to 90 videos at this point and plan on making many more

derekbanas
Автор

Thank you :) I'm very happy that they are helping. Always feel free to ask questions. Also, feel free to skip parts 8 and 10 of this video series. I didn't care for how they turned out.

derekbanas
Автор

You're very welcome :) Im glad you liked it. The only books I ever recommend is the head first series. Dietel has books loaded with examples though. You may prefer it

derekbanas
Автор

You're very welcome. Always feel free to ask questions

derekbanas
Автор

Wish my Java class went at this speed.  I already learned Visual Studio and this is basically different syntax which I'm sure why this is coming so easy to me.  Its just a bit redundant in class when the professor wants to start the semester off with any language with "The history of computers and so forth".  Anyways, I thank you for all you vids., much appreciated! 

HezyFoShizy
Автор

Thank you :) A static method can't access a non-static field without creating an object (instance) of that class. Statics are accessed by calling the class. Non-statics are accessed by creating an object from the class that you then use to call those non-static methods and fields.

derekbanas
Автор

Thank you :) When you declare a variable as static that just means that every object created from the class shares that variable. So if a Dog object of type Animal saves "Meat" in the favoriteFood static variable, a Cat object of the Animal class will automatically have "Meat" in its favoriteFood variable. As the tutorial continues I cover static functions and variables over and over. You'll get it

derekbanas
Автор

Thank you :) I really appreciate that. I'm still making Java tutorials right now I just am working on more advanced topics like Design Patterns in Java and UML. I will cover refactoring (Writing Good Code) with Java next. Then I'll make about 6 months of videos on Java / Android games and stuff

derekbanas
Автор

i took java as a senior in high school but in college they are teaching us c++ and i already forgot everything about java. The good thing if you know a one language the other seen easy to learn. So don't give up guys !!!

thetechnoob
Автор

@alexgidge Yes a function is the same as method. public means anyone can execute the function. static means that only a class can call for this function to execute. void means that no value is passed back when the function / method stops execution

derekbanas
Автор

Thank you very much :) I don't put any restrictions on how people watch my videos. I know some people block videos on mobile devices but I don't. I'm very happy that you enjoy them !

derekbanas
Автор

No you don't need to add public unless you want methods to be accessible outside of the package. If you put nothing then you'll get a default that is similar to protected status. Protected is like private, but everything is accessible to any thing in the same package. Static is used when you want to share a variables value between every object. Static methods are used to work with static variables. I hope that helps

derekbanas
Автор

It is a random name. You have to define any values you want to pass into a method. That is what the 2 ints are

derekbanas
Автор

Yes as long as you understand that when the method hits the first return it will leave the method and not hit the second. This is done all of the time when you want to return 1 value under certain circumstances and another value under another circumstance

derekbanas
Автор

@SuggestiveSquirrels Thank you :) It makes me very happy that you like the videos!

derekbanas