java development companies in Bangalore
-
Upload
shreya-anand -
Category
Technology
-
view
308 -
download
2
description
Transcript of java development companies in Bangalore
Introduction Present the syntax of JavaIntroduce the Java APIDemonstrate how to build
stand-alone Java programsJava applets, which run within browsers e.g.
Netscape
Why Java?It’s the current “hot” languageIt’s almost entirely object-orientedIt has a vast library of predefined objects and
operationsIt’s more platform independent
this makes it great for Web programmingIt’s more secureIt isn’t C++
Applets, Servlets and ApplicationsAn applet is designed to be embedded in a
Web page, and run by a browserApplets run in a sandbox with numerous
restrictions; for example, they can’t read files and then use the network
A servlet is designed to be run by a web server
An application is a conventional program
Java Virtual MachineThe .class files generated by the compiler are
not executable binariesso Java combines compilation and
interpretationInstead, they contain “byte-codes” to be
executed by the Java Virtual Machineother languages have done this, e.g. UCSD
PascalThis approach provides platform
independence, and greater security
HelloWorld (standalone)
Note that String is built inprintln is a member function for the
System.out class
public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); }}
Comments are almost like C++/* This kind of comment can span multiple lines */// This kind is to the end of the line/** * This kind of comment is a special * ‘javadoc’ style comment */
Primitive data types are like CMain data types are int, double, boolean, char
Also have byte, short, long, floatboolean has values true and falseDeclarations look like C, for example,
double x, y;int count = 0;
Expressions are like CAssignment statements mostly look like
those in C; you can use =, +=, *= etc.Arithmetic uses the familiar + - * / %Java also has ++ and --Java has boolean operators && || !Java has comparisons < <= == != >=
>Java does not have pointers or pointer
arithmetic
Java program layoutA typical Java file looks like:
import java.awt.*;import java.util.*;
public class SomethingOrOther { // object definitions go here . . .}
This must be in a file named SomethingOrOther.java !
What is a class?Early languages had only arrays
all elements had to be of the same typeThen languages introduced structures
(called records, or structs)allowed different data types to be grouped
Then Abstract Data Types (ADTs) became populargrouped operations along with the data
So, what is a class?A class consists of
a collection of fields, or variables, very much like the named fields of a struct
all the operations (called methods) that can be performed on those fields
can be instantiatedA class describes objects and operations
defined on those objects
Name conventionsJava is case-sensitive; maxval, maxVal, and
MaxVal are three different namesClass names begin with a capital letterAll other names begin with a lowercase letterSubsequent words are capitalized: theBigOneUnderscores are not used in namesThese are very strong conventions!
The class hierarchyClasses are arranged in a hierarchyThe root, or topmost, class is ObjectEvery class but Object has at least one
superclassA class may have subclassesEach class inherits all the fields and methods
of its (possibly numerous) superclasses
Presented By: 5ine Web solution pvt. Ltd
http://www.5ine.in 5ine Web Solutions Pvt. Ltd.
Bengaluru, Karnataka , India 560078
Mobile +91-88844-11366 Landline +91-80-26663298
Email : [email protected]
Thank you.