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

Java

Published in: Java And J2EE
6,402 Views

Intro to Java

Aravind / Mangalore

3 years of teaching experience

Qualification: MCA ( - 2013)

Teaches: MS Office, IT & Computer Subjects, B.Sc Tuition, BCA Tuition, Computer Science, IT, C, C++, BCA Subjects, MCA Subjects

Contact this Tutor
  1. JAVA EVOLUTION
  2. Java: General purpose,object programming language- Sun Microsystems Problems with c and c++ - reliability and portability. Simple,reliable,portable and powerful lang. Platform neutral language
  3. Features of java: Compiled and interpreted : Two stage system Java compiler Java interpreter a Platform independent and portable: independent of changes and upgrades in OS,processors and s/m resources Programming on internet,downloading java applets
  4. byte code instructions implemented on any m/cs Primitive data type size is m/c independent a Object oriented: Data reside within objects and classes(packages) Object model- simple and easy a Robust and secure: strict run time and compile time checking for data types Garbage collected language
  5. Exception handling mechanism Ensures s/m with no virus Proper authorization to access memory locations a Distributed: Creating apps.on networks Sharing of both programs and data Accessing remote objects a Joint work with multiple programmers at multiple places
  6. Simple,small and familiar: Modeled on c and c++ Uses constructs Ofc and c++ a Multi threaded and interactive: Handling multiple tasks Tools that support multi process synchronization a High performance: Interpreted language Increase in execution speed because of multithreading
  7. Dynamic and extensible: Linking class libraries,methods and objects Support functions written in other langs. a Ease of development: J2SE 5.0 support many features- generics,auto boxing and unboxing,annotation etc Reduce the work of programmer,less errors a Scalability and performance: Increasing start up time and reducing the amount of memory used
  8. Monitoring and manageability: Java supports a number of APIs to monitor and manage java apps.
  9. Difference b/w java and c: No C keywords - sizeof & typedef No Data types - struct and union No use of auto,extern,register,signed and unsigned No pointers No use of preprocessor directive No use of void keywords Use of new operators - instanceof & >>> Use of labeled break and continue statement Addition of many features of object oriented programming
  10. Java and c++: Java does not support: 1. opertor overloading 2 .template classes 3.mulitple inheritance of classes 4.global variables 5.pointers destructor function has replaced with finalize() function No header files in java
  11. H/w & s/w rqmnts: Windows 95,Windows 95,Windows solaris,Macinthosh & UNIX m/ cs For Windows based s/ m: An IBM compatible 480 s/m Minimum of8 MB memory Windows 95 s/w Windows compatible sound card Hard drive CD - ROM drive A microsoft compatible mouse
  12. Java support s/ ms: Internet conncetion Web server Web browser HTML - creates hypertextfor the web APPLET tag- places java applets in HTMI doc. Java code - define java applets Byte code-coompiled java code which refers to APPLET tag &transferred to user s/m
  13. Java environment: It includes development tools(Java Development and methods(Java Standard Library(JSL)) APIs(Application Programming Interface)
  14. JDI
  15. How the above tools are used: Create a source code file Compile the source code To find any errors Executing the code To convert compiled java prgm code ... into source
  16. APIs: Commanly used packages under APIs: 1.Language support package - basic features of java 2. Utilities package - ultilityfunctions 3.i/p &o/p package 4.Network package 5.AWT package -platform independent GUIs 6.Applet package - create java applets
  17. 2 - types of java programs: l)stand alone apps. -programs written to carry out certain tasks Execution: a)compiling b)executing 2) Web applets - programs developedfor internet apps, Note:We can execute java applets from distant computer by downloading it via internet using java capable web browser
  18. Applets cannot run without web browser Simple java program: Class SampleOne public static void main(String args[]) System.out.println("java prgms.
  19. Public - declares main method as unprotected Static - declares the method to entire class Void- main does not return any value Note: All parameters to the method are declared inside a pair of parentheses System.out.println("java progrms.. , is only executable statement in above program.
  20. Example: lava program: Import.java.lang.Math; Class SquareRoot public static void main(String args[]) double x =5; double y; y=Math.sqrt(x); System.out.println("y=
  21. An apprwith two classes: Class Room float length; float breadth. void getdata (float a,float b) length=a; breadth=b;
  22. class RoomArea public static void main(String args[]) float area; Room rooml = new Room(); Room1.getdata(14,10); area=rooml.length*rooml.breadth; System.out.println("Area =" + area);
  23. Java program structure: Documentaion section Package statement Import statements Interface statements class definitions Main method class Main Method Defintion
  24. Documentation section : l.details of program,comment lines,manipulating the program documentaion comment a Package statements: 1. First statement in java 2. Defines package name 3. Tells the compiler that defined classes belong to named package
  25. a Import stetement: a 1. To access the classes that are part of other named packages a Interface statements: L To implement multiple inheritance feature in the program a Class defintions: to map the objects a Main method class: 1. Creates objects of various classes
  26. Java tokens: Smallest individual units in a program. Java program is a collection of tokens ,comments and white spaces 5-types of tokens available in java: 1. reserved keywords 2. identifiers 3.1iterals 4.operators 5. separators
  27. Java, character set: JCSs are defined by the Unicode character set Commanly used character set is ASCII Keywords: Case, abstract, default, try, void, this, while, long etc Identifiers: a Programmer defined tokens for naming classes,methods,variables,objects,labels,packages &interfaces.
  28. Rules for framing identifier: 1. They can have alphabets,digits,underscore and dollar sign character 2.1t must not begin with a character 3. Uppercase and lowercase letters are different 4. They can be of any length