Added: 3 years ago
From: StanfordUniversity
Views: 66,867
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:
see all

All Comments (84)

Sign In or Sign Up now to post a comment!
  • He needs to add a close brace before writing the method body! It's a really good habit to get into.

  • @Phl3xable Most IDEs do that automatically.

  • Comment removed

  • best explanation of the 'this' pointer ive found! top notch lectures mate

  • "Yeah! Good Times"

  • Comment removed

  • wow.guys in speedos! i want to go to class at stanford!

  • I've been watching these lectures for the past two days now they're awesome:) feel like i've done a crash course at Stanford Uni and saved 50 grand!! haha... I could watch these vids all day and i probably will:).

  • Can I touch your variables?

  • Stanford Swim Team!

  • omgb this stuff is easy how is there a university course on this

  • @PONY4LYFEHAHDERP Although it's easy, that doesn't mean an academic student shouldn't know this. And the speed of the lectures is certainly up to academic standards if you ask me.

    Just wish my professors taught me like Mehran does, I just got clubbed to death with math formulas and proofs. Well, teaching CS was still in it's infancy back in the early 90's.

  • @jjjdeste Even if it is indeed, up to academic standards, I was led to believe that Stanford University was above standards, is it not? Just as implied, in i believe, lecture one, where the professor claims the students to be above average. Does this not mean that the academic standards should be brought up to the level of such BRILLIANT students?

    All the math formulas that you've been "clubbed to dead with" you should have learned in grade school, or at least first year university math.

  • @PONY4LYFEHAHDERP Even brilliant students have to learn the stuff they don't know yet, I think these lectures are doing a terrific and speedy job of teaching this material to smart people who potentially don't know anything about the subject yet.

    I AM talking about first year uni math. This course is first year too, right? I got straight A's for math in grade school, but was very disappointed to ONLY see math and virtually NO computers or programming at all in my first year CS.

  • @PONY4LYFEHAHDERP Dude this is just like basic stuff for people that have no prior knowledge of coding. He stated that in the first Lesson, if you weren't such a pinoy snub you would actually know that he also said that there's a course for adept/advance student "extreme" which is called CS106x.

  • @BmCNinJa No, it's called "Accelerated" xD

    CS106A was taken so they had to come up with another letter for accelerated :P

    Xcelerated

  • STANFORD SWIMMING! STANFORD SWIMMING!

  • WHY ISNT THIS VIDEO HD/HQ?! >:(

  • Comment removed

  • 31:51 This is Why Stanford is one of the BEST University in the WORLD..

    Thumb Up if You agree..

  • What the hell just happened there?!

  • UseCounter program doesn't work...

  • 1 person wasn't on the swim team...

  • @ZenDDavis Constructors are used to pass parameters into instances of classes just like passing parameters into functions

    MyClass myCls = new MyClass(100);

    If 'MyClass' didn't have a constructor that took an int I would have to declare the class then assign the int a value (for that instance);

    MyClass myCls = new MyClass();

    myCls.MyPublicInt = 100;

    using a constructor forces you to assign the int a value when you create a new instance (which might be important for each instance of the class)

  • I still don't understand exactly what constructors do. Could someone help explain?

  • @ZenDDavis look up "Java Programming Tutorial - 17 - Constructors" from thenewboston on youtube.

  • That 1 dislike is the person that missed class.

  • I wish I found it sooner

  • sick Eclipse looks so much like Jcreator

  • Stanford Swimming~~~ haha

  • I‘m watching these lectures,seeking for friends,my twitter ID:caiyuhui

  • Salam

    1. when running the Stanford class an object is being created(i.e an instance of Stanford)...

    2. the "Stanford object" will reference the stud object that is created from class Student

    3. the stud object is held in the Student class

    ~~~~~~~

    is that right??? 

  • he makes the return methode for the counter: { int temp=counter; counter++; return temp; } but just as easy is: { counter++; return (counter-1); }
  • @imorio His code contains one assignment operation, one arithmetic operation, and the return, whereas yours contains two arithmetic operations (slower) and then the return.

    For the truly anal, adding one initial subtraction can save us one operation on each iteration of the method (and discard his extra line):

    int counter = StartValue - 1;

    the method then reads: { counter++; return counter;}

    Correct me if I'm wrong though, as I only very recently began my foray into programming.

  • @fakexaveir There's a neat little trick you'll learn in Lecture 16, wherein you discover '++' is just a method which actually returns the value of the variable it is being called on before said variable was incremented.

    Knowing this, you can simply write the function as follows:

    { int temp = counter++; return temp;}

  • 31:54 Stanford swimming, Stanford swimming, Stanford swimming Yes, it's true: Stanford looks forward to winning their 29th-straight Pac-10 Men's Swimming Championship. Yet despite that, I would have preferred the Stanford Women's Swimming team running in Speedos through Mehran's class.

  • At 49:50 he creates an instance named, "stud" of a class named, "Student."

    Naming the instance, "stud" is bad practice. Spell the complete word for clarity. Since Java is case sensitive, it is preferable to name the instance, "student" because there will be no conflict. Classes should be defined in Pascal Case, and naming the instance using Camel Case makes for a natural association.

  • The fact that the teacher had to tell the class that the word, "stud" was a student and not some other common slang word, should have been a red flag that his name was a poor choice. Don't make the user of your code have to guess. Your name choices help document the code for future maintenance and readability.

  • At 19:32 the professor didn't have to create a temp variable. He could have returned,

    ++counter

  • @Entropy56 Uh well, actually it should be counter++ because if you do ++counter the value gets incremented before being returned. But you're right about not having the need to create a temp, but I think Prof. Mehran did that just to illustrate it clearly.

  • @kyrdsin You're right.

  • when u do the assignments, how do you know what methods you can call that are built in..like the acm library console program library..i dont see it in java api

  • I'm so lost. Java is so complex for me...I'm a newbie, started with lecture 1 and around lecture 6-9 things are getting so confusing...what do i do???

  • @sharpnmild Go back to the bits you don't understand (where you start to get confused) and make sure you understand that part before moving on again.

    The best way, at least for me, to learn something, is by testing it out by myself, I recommend that you do what he is doing in the videos whilst trying to understand what you are doing, not just typing in what he is typing in. And also try adding more onto the stuff he does into the video,using the stuff you learnt earlier.

  • @sharpnmild This is what you do. DL or Buy other java books. Have multiple sources and read the same concepts in each book. You will get multiple perspectives on each idea and it helps you put it all together. After that, learn by programming. I recommend Head First Java. It's a little unconventional, but it really helps you understand the ideas behind the language.

  • @bearhuntaa Head First Java will it be better if I read it now/after/during this course?

  • @jellybellies132 read it now, and code what these lessons and the book teaches you at the same time.

  • take your time, the best advice i can offer is learn from lots of different great sources on 3dbuzz there are amazing c# tutorials (the languages are very similar) which goes over all these concepts, they are unfortunately not free but the secondary explanations of the same concepts in my opinion helps to reinforce the learning. If you are very confused, go back and dont progress until you understand. pause and use google if theres a specific thing you dont understand.

    peace

    Brian

  • p.s (there wasnt room in the box)

    as has been said try it out for yourself download eclipse and test what he is saying example by example, experiment ...the worst that you can do (touch wood) is have it not run or crash.

    the IDE will provide error messages which will explain why its not working and you can google search them to see what they mean if not self explanatory.

    Keep at it, it gets easier :)

    peace

    Brian

  • @sharpnmild i agree

  • are the handouts available as well ?

  • Thanks a lot Stanford & Prof. Mehran... Your lectures are of great help for people don't have resourses to learn java.

  • "dogs and cats are sleeping together, everything's out of control!"

    Great teacher or greatest teacher?

  • Now i now how to program Karel the Robot, I have good java programming skills and I only on lecture nine! Thank you Stanford and THANK YOU Mehran, I'm a new big fan.

  • i could not dissolve this lecture i tink i should go through the lecture again

  • Love what he says at 11:00

    "You are an object, most things on an object are private."

    Humans are objects too!

  • @Bulacanos yes, he is so lovely! In previous lectures he said people are objects, when he explain classes, superclasses and other stuff!

  • strings

  • hes a cool dude

  • this lecture uncoverd alot!

    and wow i still can't belive i'm watching a full cs course of stanford in israel.

    btw, isn't professor Sahami brilliant in the way he lectures? it's insane! stanford surely knows how to pick it's teachers.

    thank you stanford for providing these videos to youtube, i hope i would find more CS courses besides 106a/b/x in the future.

  • What a great teacher!!!!

  • Lol at 31:50

  • poppin candy at the last man... man! thats a cool reflex... at situations like all i can do is to stand erect and keep watching

  • ..."Stanford Swimming"...

  • good times:)!!!!

  • ^^ Nice to know that Stanford University was founded by ppl from Germany. I am from germany and was astonished to read german on the University Sign (the one with the Tree on it). It says sth. like: "Der Wind der Freiheit weht." --transfered to english--> "The wind of freedom blows." ;). Just if anyone was wondering what it means.

  • good

  • Thank you so much! I'm having such a hard time understanding my professor and things just seem to clear up watching this.

  • THIS WAS THE BEST LESSON YET!

  • i like him, i think that he does it in purpose

  • he's a good teacher. Just talks a bit too fast. But in a way, talking faster is better than talking slower cause it keeps you alert =)

  • Watch CS106B...then you'll take back "talks too fast" :-)

  • lol

  • Where can I see CS106B. I like this teacher, but I'm more of a C++ guy.

  • --> Course Programming Abstractions

  • 31:54

Loading...
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more