Looking for a Tutor Near You?

Post Learning Requirement » x
Ask a Question
x

Choose Country Code

x

Direction

x

Ask a Question

x

Hire a Tutor

Fundamentals Of JAVA

Published in: Java And J2EE
6,983 Views

This presentation conveys the information and the basic knowledge of JAVA and its importance in the programming langauges.

Mohana V / Visakhapatnam

1 year of teaching experience

Qualification: B.Tech

Teaches: Data Structures, DBMS & RDBMS, PL/SQL, C, C++, Java And J2EE, AJAX Training, Java Script

Contact this Tutor
  1. N/A
  2. why Java„,? , Simple Object - Oriented , Platform independent - , Secured , Portable Distributed , Robust High Performance , Multithreaded WORA i1001ölÆE *010111C iiiiilC
  3. Overview e Basics OOPs concepts , Strings , Exception Handling , Multithreading , IOStreams , Collections , JDBC Servlets JavaScript JSON JSP XML JAXB i1001ölÆE *010111C iiiiilC
  4. JDK , JRE & JVM J VM - loads,verifies and executes the code and provides the runtime environment. Class loader Class files su b syste m Ill i1001ölÆE *010111C iiiiilC Method area Execution Engine Heap J ava stacks Registers Native method sta cks Native method library 1 1 Runtime data areas Native method interface
  5. JRE - implementation of J V M, it physically exists,has set of libraries(jars). i1001ölÆE *010111C iiiiilC JVM set of libraries e.g. rt.jar etc. other files JRE
  6. JDK - contains JRE with development tools(javac,java). set of libraries e.g. rt.jar etc. JVM other files JRE JDK Development tools e.g. javac,java etc. i1001ölÆE *010111C iiiiilC
  7. · Polymorphism · Inheritance · Encapsulation Object Class Abstraction OOPS Concepts
  8. Classes and Objects Class - template or a blueprint where objects are created/ group of similar objects Object - instance of class & exists physically , Constructors - used to initialize the object & is invoked at the time of object creation Wrapper Classes - to convert primitive datatypes into object and object into primitive datatypes , Autoboxing unboxing i1001ölÆE iiiiilC
  9. Inheritance , Parent - child relation , extends keyword , Types a) Single b) Multilevel c) Hierarchial d) Multiple e) Hybrid , this & super keywords Method overriding - parameter different Method overloading - parameter same i1001ölÆE *010111C iiiiilC
  10. Polymorphism , Polymorphism - performing one action in different ways , Type casting - conversion of one datatype to other datatype Upcasting - variable of Parent class refering to the object of Child class , Downcasting - an object of a base class convert into the type of one of the derived classes , instanceof operator - to check whether the object is an instance of the specified subclass or interface i1001ölÆE *010111C iiiiilC
  11. Abstraction & Interfaces Abstraction - Hiding internal details and showing functionality Abstract class - can have non-abstract classes Interfaces - will have only abstract classes Ill *010111C iiiiilC Interface Intefface support multiple inheritance Intefface does'n 'Cantains Data Member Interface does'n contains Constructors An interface Contains only incomplete member (signature of member) An interface cannot hawe access modifiers by default everything is assumed as public Member af interface can not ba Static Abstract class Abstract class does not support multiple inheritance Abstract class contains Data lVlember Abstract class contains Constructors An abstract class Contains bath incomplete (abstract) and complete member An abstract class can contain access modifiers far the subs, functions, properties Only Complete Member of abstract class can be Static
  12. Control Structures & Arrays Looping Statements a) for b) while c) do..while Control Statements a) if, else.. if b) switch Selection Statements - break,return Single Dimensional array - Multi Dimensional array - i1001ölÆE *010111C iiiiilC
  13. Strings , Immutable , Substring Methods of String class StringBuffer class StringBuilder class , StringBuffer vs StringBuilder String Tokenizer , String comparison - equals(),—=,compareTo() String concatenation - concat(),+ i1001ölÆE *010111C iiiiilC
  14. Exception Handling Hierarchy , Types of exceptions , Keywords — try,catch,finally,throw,throws , Try — catch block , Finally block Throw vs Throws , Exception Propagation Final vs Finally vs Finalize Custom Exception i1001ölÆE *010111C
  15. Multithreading Life cycle of a thread Creating a thread Sleep Wait , Joining a thread Thread priority , Daemon thread Thread pool & Thread group Thread Scheduler i1001ölÆE *010111C iiiiilC
  16. Synchronization What actually is Synchronization..? Why synchronization..? Thread synchronization & types Mutual Exclusive a) Synchronized method. b) Synchronized block. c) Static synchronization. Cooperation (Inter - thread communication) Deadlock i1001ölÆE *010111C iiiiilC
  17. Collections Collection represents a single unit of objects Collection (Interface) / Ill i1001ölÆE *010111C iiiiilC HashSet Linked HashSet Set (Interface) Sorted Set Tree Set List (Interface) ArrayList Vector Queue (Interface) LinkedList Map (Interface) HashMap Hashtäble Priority Queue Linked HashMap SartedMap interface TreeMap COLLECTION HIERARCHY
  18. No Duplicate Set Core interface Collection List Ordered ojlection Not Sync. VnOrdered, allow Null HashSet Not Sync, Ordered (maintains doubly linked list).allow null LinkedHashSet Not Sync, Gurantees natural order (Comparable interface), faster SoctedSet Not Synchronized Synchronized Vector TreeSet Color b&te Interface Concreateaass i1001ölÆE *010111C iiiiilC Not Synch, List but can work as stack, queue, deque Linked-ist multiple ele ents prir to p ocessiry Queue Null not allowed.Ordered basis of Pririty Heap PriorityQueue
  19. Null Not allowed, Synchrmized HashTable Null Allowed,slower than HashMap, Dubly Linked list used intemally i1001ölÆE LinkedHashMap Color bbte Null Allowed, Not Sync *010111C iiiiilC Key • Value Collect n HashMap Map Intecface Concreateaass Srted in Natural Order,Null Allowed
  20. Collection Interface Concrete Implementation Class HashMap Hashtable TreeMap LinkedHashMap I-lashSet TreeSet LinkedHashSet Array St Vector LinkedList Priorityaueue Map x x x x Set x x x Classes List _x x x Ordered No No Sorted By insert;on order or last access order Sorted dy insertion order By index ay index By index Sorted Sorted No By natural order or custom comparison rules NO By natural order or custom comparison rules By to-do order Ill i1001ölÆE *010111C
  21. IOStreams , Types of streams a) Binary b) Character Hierarchy i1001ölÆE *010111C iiiiilC a) b) d) InputStrream OutputStream Reader Writer
  22. InputStream Methods of InputStream Hierarchy iiaølö* Fil filterInputStrean Sequencelnput>trear St titJ8u vutSt rean BufferedIr,putStrean PushbackInputStrean
  23. OutputStream Methods of OutputStream Hierarchy PI pecDutputStreaJ11 FiltelültputStredlll OutputStrea111 6yte4rray011tplltStreälll Object0utplltStreå111 i1001ölÆE *010111C iiiiilC Oata0utputStrealll BufferecblltplItStreålll Pm ntStrEII
  24. Reader class Hierarchy guffcredkcadcr Inputstreaffieader i1001ölÆE *010111C iiiiilC
  25. Writer Class Hierarchy FTI Terwrltef' Pi ged'åriter i1001ölÆE *010111C iiiiilC
  26. Binary vs Character , InputStream OutputStream , File1nputStream , FileOutputStream , StringBufferedInputStream , ByteArrayInputStream , ByteArrayOutputStream , PipedInputStream , PipedOutputStream Reader , Writer , FileReader , FileWriter , StringReader StringWriter , CharArrayReader , CharArrayWriter , PipedReader , PipedWriter i1001ölÆE *010111C iiiiilC
  27. IOStreams contd... , Serialization - it is a mechanism of writing the state of an object into a byte stream. Marker interface - interfaces with no field or methods or empty interface in java is called marker interface Implements serializable interface Deserialization Transient keyword *010111C iiiiilC
  28. JDBC , What is JDBC..? , Its uses. 2 , Types of Drivers a) JDBC-ODBC bridge driver b) Native - API driver c) Network Protocol driver d) Thin driver Classes & Interfaces i1001ölÆE *010111C iiiiilC
  29. JDBC - ODBC Driver JdbcAPl Java Application JDBC-ODBC bridge driver Client Machine ODBC Driver Vendor Database Library i1001ölÆE *010111C iiiiilC Database Figure-JDBC-ODBC Bridge Driver
  30. Native — API JdbcAPl Java Application Driver Vendor Database Library i1001ölÆE *010111C Native API driver Client Machine Database Figure- Native API Driver
  31. Network Protocol Driver JdbcAPl Java Application i1001ölÆE *010111C iiiiilC Network Protocol driver Client Machine Database Middleware Server side Figure- Network Protocol Driver
  32. ?? ? ??? ??? ????? ??????: ? ???????.-.---.- ?? ?? ??????i??i11I ?? ???? ?? — «? «??? ??" ???????? ?????? ?? ???????????
  33. Connectivity Steps , Register the driver class - Class.forName("oracle.jdbc.driver.OracleDriver Create the connection - Connection con=DriverManager.getConnection("jdbc:oracle:t hin:@localhost:1521:xe","system","password"); Create the statement — Staternent stmt=con.createStatement(); Execute queries & get the results — ResultSet rs=stmt.executeQuery("select * from emp"); Closing connection - con.close() i1001ölÆE *010111C iiiiilC
  34. , Prepared statement - parameterized query , Callable statement - for stored procedures & functions , Transaction management - ACID properties a) Atomicity b) Consistency Isolation d) Durability , Batch processing - addBatch(), executeBatch() CLOB - file - setBinaryStream() & getC10b() BLOB - image - setBinaryStream() & getB10b() i1001ölÆE *010111C iiiiilC
  35. Servlets What is a Web application..? , CGI , Servlet - used to create web application that resides at server side Hierarchy , Life cycle Servlet GenericServlet HTTPScrv10t MyServlet *010111C iiiiilC a) b) c) Init Service Destroy
  36. Servlet Collaboration RequestDispatcher a) forward() b) include() Ill i1001ölÆE *010111C iiiiilC Name Password Include Lozin Index.html No html file Validate Servlet Is valid? error Yes orwar Welcome, o Welcome username Serviet Sorry' username or password Name password Login sendRedirect()
  37. , Session Tracking a) Cookies b) Hidden Form Field c) URL Rewriting d) HttpSession , ServletConfig - An object of ServletConfig is create by the web container for each servlet and can be used to get configuration information , ServletContext - There is only one ServletContext object per web application , Deployment Descriptor i1001ölÆE *010111C *iiiilC
  38. JavaScript What is JS..? , Uses of JS..? Basics a) b) c) d) i1001ölÆE *010111C iiiiilC Datatypes & variables Comments Operators Control & looping statements JavaScript objects a) String b) Array
  39. , JavaScript BOM a) Window object b) History object c) Navigator object d) Screen object , JavaScript DOM a) getElementsbyId b) getElementsbyName c) getElementsbyTagName , Event Handlers , JavaScript innerHTML & innerText property i1001ölÆE *010111C iiiiilC
  40. AJAX , What is AJAX..? , Synchronous vs Asynchronous AJAX Technologies XMLHttpRequest object - properties,methods , How AJAX works..? Working with text - responseText Working with XML - responseXML , JSON - features var jsonObj = JSON.parse(request.responseText); i1001ölÆE *010111C iiiiilC
  41. JSP , Life cycle a) b) c) d) f) Translation of JSP Page Compilation of JSP Page Classloading Instantiation Initialization Request processing Destroy i1001ölÆE *010111C iiiiilC , JSP API a) javax.servlet.jsp b) javax.servlet.jsp.tagext
  42. , Scripting elements a) Scriplet tag - < % java source code %> b) Expression tag - c) Declaration tag - , Directive elements a) Page - b) Include - c) Taglib - Action elements i1001ölÆE *010111C a) b) c) d) e) Forward - Include - UseBean Set property Get property
  43. , Implicit objects - Objects created by the web container that are available to all the jsp pages. Object out request response config application session page pageContext exception Type JspVVriter HttpServ1etRequest HttpServletResponse ServletConfig ServletContext HttpSession Object PageContext Throwable i1001ölÆE *010111C iiiiilC
  44. , JSTL - represents a set of tags to simplify the JSP development a) Core tags b) Sql tags c) Xml tags d) Function tags e) Internationalization tags , JSP Custom tags a) Tag handler class b) Tag Library Descriptor c) JSP file that uses custom tag i1001ölÆE *010111C iiiiilC
  45. XML What is XML..? Well formed XML i1001ölÆE *010111C nui*10 a) b) c) d) e) f) g) It must begin with the XML declaration. It must have one unique root element. Matching start and end tags. XML tags are case sensitive. All elements must be closed. All elements must be properly nested. All attributes values must be quoted.
  46. , Valid XML a) XML DTD b) XML Schema , XML DTD a) employee SYSTEM b) attribute c) entity-name , XML Schema a)
  47. DTD vs XSD DTD DTD doesn't support datatypes. DTD doesn't support namespace DTD doesn't define order for child elements. DTD is not extensible DTD provides less control on XML structure. DTDs are derived from SGML syntax. DTD stands for Document Type Definition. DTD is not simple to learn. XSD XSD supports datatypes for elements and attributes. XSD supports namespace. XSD defines order for child elements. XSD is extensible. XSD provides more control on XML structure. XSDs are written in XML. XSD stands for XML Schema Definition. XSD is simple to learn because you don't need to learn new language. i1001ölÆE *010111C iiiiilC
  48. , XML Parsers a) DOM Parser b) SAX Parser Differences and SAX Ill *010111C iiiiilC Standardization Manipulation Memory Consumption XML handling DOM W3C Recommendation Reading and Writing (manipulation) Depends on the size of the source xml-file, can be Tree—based SAX No formal specification Only Reading Very low Event-based
  49. , XPATH a) Root Node - the root of the document b) Element Nodes - each element of document c) Attribute Nodes d) Namespace Nodes e) Processing Instruction Nodes f) Comment Nodes g) Text Nodes , JAXB - Java Architecture for XML Binding a) Javax.xml.bind.JAXB class b) Java object to XML - Marshalling c) XML to java object - Unmarshalling d) JAXBContext object i1001ölÆE *010111C iiiiilC
  50. Hibernate , What is a Framework..? , What is hibernate..? , What actually is the concept of ORM(Object i1001ölÆE *010111C iiiiilC Relational Mapping) ? ORM Java object Application Database
  51. , Advantages of Hibernate Framework : a) Opensource a) Lightweight a) Fast performance a) Database Independent query - HQL a) Automatic table creation a) Simplifies complex join - To fetch data form multiple tables a) Provides query statistics and database status i1001ölÆE *010111C iiiiilC
  52. Architecture Transaction Session Factory JNDI JDBC Database JTA Internal API Used by Hibernate i1001ölÆE *010111C iiiiilC Java Application Persistent object Connection Provider Session Transaction Core objects of Hibernate Framework
  53. , Elements of Hibernate architecture a) SessionFactory - org.hibernate.SessionFactory - is a factory of session and client of ConnectionProvider a) Session - provides an interface between the application and data stored in the database a) Transaction - org.hibernate.Transaction - it specifies the unit of work done. a) ConnectionProvider - provides with connections a) TransactionFactory - factory of transaction i1001ölÆE *010111C iiiiilC
  54. , Steps to create hibernate application a) Create the Persistent class - POJO classes/ getters and setters methods a) Create the mapping file for Persistent class a) Create the Configuration file - properties a) Create the class that retrieves or stores the persistent object - class file a) Load the jar file a) Run the application i1001ölÆE *010111C
  55. , Hibernate with annotations a) @Entity - marks the class as an entity. a) @Table - specifies the table name where data of this entity is to be persisted a) @ld - marks the identifier for this entity. a) @Column - specifies the details of the column for this property or field , Hibernate Dialects a) DB2 - org.hibernate.dialect.DB2Dialect b) MySQL - org.hibernate.dialect.MySQLDialect c) Oracle - org.hibernate.dialect.OracleDialect i1001ölÆE *010111C iiiiilC
  56. ????????? ?????? ???? ?? ?? !"Ell •••%IIN—:•• ?? ????? : — «? «??? ??" ??????? ??????? ?? ??????????? r-•llh ????ir ?? 10111111