Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Jumping Into Java Then!

1,054 views

Published on

A presentation that I gave in one of the late night sessions in my college, aimed at bringing an awesome bunch of my juniors up to speed with Java.

Published in: Technology, News & Politics
  • Be the first to comment

Jumping Into Java Then!

  1. 1. Java: It’s OOP on Steroids*!<br />Presented by: Milan a.k.amondodello<br />( Aah! Back into known territory! )<br />*STATUTORY WARNING: This presentation is not an attempt to popularize steroids. Steroids and more specifically drugs are injurious to health. One must never buy drugs. One should rather become a rockstar. Then you get them for free :P :D !<br />
  2. 2. Topics (intended) to be covered<br />OOP: A rrrrapid review<br />C / C++ and now … err … Java?<br />Java: The new kid on the block!<br />Regular Feature: Some Gyaaan!<br />What NEXT?<br />
  3. 3. OOP: A quick look back<br />
  4. 4. Hmm … so we meet again …<br />OOP is a relatively ‘new’ programming paradigm<br />Competes with Structured Programming<br />Avoids REDUNDANCY, provides FLEXIBILITY<br />Involves lot of jargons <br />Modularity<br />Abstraction / Data Encapsulation / Info Hiding<br />Inheritance<br />Polymorphism<br />
  5. 5. C, C++ and now Java? Stop throwing jargons at me please!<br />
  6. 6. Why C? Why C++?<br />Procedural Programming: C<br />C + Classes + … = C++<br />Main problem: Lack of portability<br />That’s primarily what Java builds upon …<br />
  7. 7. Java is born …<br />
  8. 8. Once upon a time…<br />Started by Sun Inc. under codename OAK<br />The Retransformation<br />HotJava<br />Built on the WORA paradigm<br />
  9. 9. WORA: No it’s not a battle-cry!<br />Stands for Write Once Read Anywhere<br />Brainchild of James Gosling<br />Stresses primarily on portability and strict adherence to specifications<br />Enters JVM!<br />
  10. 10. JVM: The Java Virtual Machine<br />It’s Java’s own Interpreter<br />Custom built for different platforms<br />Just worry about your class file, Java takes care of the rest!<br />
  11. 11. Architectural Layers<br />
  12. 12. nuts-’n-bolts of a Java Program<br />
  13. 13. The integral parts<br />Header Files (Use import)<br />Class Definition(s)<br />main() within the class<br />
  14. 14. A Java class format<br />Class &lt;class name&gt;<br />{<br />//datamembers<br /> &lt;access modifiers&gt; &lt;data type&gt; &lt;variable name&gt;<br />//function definitions<br /> &lt;access modifiers&gt; &lt;return type&gt; &lt;function name&gt; (comma-separated parameter list)<br /> {<br /> body – of – the - function<br /> }<br />}<br />
  15. 15. Java ripped apart!<br />
  16. 16. This comprises Java – <br />Variables/Constants/Arrays<br />Arithmetic Expressions/Operators<br />Control Flow Techniques<br />Pointers/References (???)<br />Methods<br />Classes/Objects<br />…<br />…<br />&lt;This is only a glimpse … &gt; !!!<br />
  17. 17. Varrrrriables<br />An element that varies<br />Vary = change<br />Contrast with CONSTANTS (Rock steady - do NOT change during program run)<br />8 types: <br />byte, short, int, long, <br />float, double, <br />boolean, <br />char<br />
  18. 18. Arithmetic Expressions<br />Rules involving variables, constants, operators etc.<br />Always evaluate to a VALUE<br />Can be used in a helluva innovative ways <br />Master them and half the battle is one<br />
  19. 19. Control Flow<br />Sequence<br />Embedded in the structure<br />Selection<br />If ... Else <br />Switch<br />Iteration<br />For<br />Do... While <br />While<br />
  20. 20. Functions a.k.a Methods<br />A small program in itself<br />Self contained<br />Input-process-output<br />Function prototype<br />Function definition<br />Arguments/Parameters<br />
  21. 21. Pointers ( ::fear::, still ?)<br />Objects as references<br />Call by Reference/Value<br />Primitive datatypes – passed by value<br />Objects – passed by reference<br />Wrapper classes<br />
  22. 22. Idiosyncrasies of Java(1 of 3)<br />Case-sensitive<br />Class Definitions do NOT end with a “;”<br />No global variable concept<br />No standalone main()<br />No non-boolean value in conditional statements<br />
  23. 23. Idiosyncrasies of Java(2 of 3)<br />No structs, enumerations, unions<br />No scope unary scope resolution operator<br />“.” operator<br />super keyword<br />Data-types sizes are FIXED, independent of machine architecture<br />
  24. 24. Idiosyncrasies of Java(3 of 3)<br />Multiple inheritance NOT supported<br />Exception handling typicality<br />Treatment of ob1 = ob2 statements<br />No destructors<br />extends keyword<br />
  25. 25. And now ... Yup, some Gyaan!<br />
  26. 26. Do this to become a Java codewhiz!<br />Be Disciplined<br />Be Regular<br />Try and compete in online coding competitions<br />Practice (Remember it makes a man perfect ... and works for women as well!)<br />Reference: http://java.sun.com/docs/books/tutorial/getStarted/index.html<br />
  27. 27. Your turn now … any questions?<br />
  28. 28. Thanks (m/)!<br />

×