SlideShare a Scribd company logo
MADE BY: SHELDON ABRAHAM
IX A
38
INTRODUCTION
 Java is a computer programming
language that is concurrent, class
based object-oriented , and specifically
designed to have as few implementation
dependencies as possible.
 Java applications are typically compiled to
byte code that can run on any Java virtual
machine (JVM) regardless of computer
architecture.
 Java is, as of 2014, one of the most popular
programming languages in use, particularly for
client-server web applications, with a reported 9
million developers.
 Java was originally developed by James
Gosling at Sun Microsystems and released in
1995 as a core component of Sun
Microsystems' Java Platform.
 The language derives much of
its syntax from C and C++, but it has fewer low-
level facilities than either of them.
HISTORY
 On 23 May 1995, John Gage, the director of the Science
Office of the Sun Microsystems along with Marc Andreesen,
co-founder and executive vice president at Netscape
announced to an audience of Sun World that Java
technology wasn't a myth and that it was a reality and that it
was going to be incorporated into Netscape Navigator.
 At the time the total number of people working on Java was
less than 30. This team would shape the future in the next
decade and no one had any idea as to what was in store.
From being the mind of an unmanned vehicle on Mars to the
operating environment on most of the consumer electronics,
e.g. cable set-top boxes, VCRs, toasters and also for
personal digital assistants (PDAs). Java has come a long
way from its inception. Let's see how it all began.
 Before Java emerged as a programming
language, C++ was the dominant player in the
trade. The primary goals that the creators of
Java was to create a language that could tackle
most of the things that C++ offered while getting
rid of some of the more tedious tasks that came
with the earlier languages.
 Behind closed doors, a project was initiated in
December of 1990, whose aim was to create a
programming tool that could render obsolete
the C and C++ programming languages.
Engineer Patrick Naughton had become
extremely frustrated with the state of Sun's C++
and C APIs (Application Programming
Interfaces) and tools.
OBJECTIIVES
There were five primary goals in the
creation of the Java language.
 It should be "simple, object-oriented and
familiar"
 It should be "robust and secure"
 It should be "architecture-neutral and
portable"
 It should execute with "high performance"
 It should be "interpreted, threaded, and
PROPERTIES
 Various features of java programming language are as given below-
 1.Java is very simple programming language. Even though you have no
 programming background you can learn this language comfortably.
 2.Java is popular because it is an object oriented programming language like
C++.
 3.Platform independence is the most exciting feature of java. That means
programs in java can be executed on variety of systems. This feature is based
on the goal
“write once, run anywhere and at anytime, forever”.
 4.Java supports multithreaded programming which allows a programmer to
write
 such a program that can be perform many tasks simultaneously.
 5.Thus robustness is the essential criteria for the java programs.
 6.Java is designed for distributed systems. Hence two different objects on
different
VARIABLES
There are four kinds of variables.
 Instance variables: These are variables that are used to store the state of an object (for
example, id). Every object created from a class definition would have its own copy of the
variable. It is valid for and occupies storage for as long as the corresponding object is in
memory.
 Class variables: These variables are explicitly defined within the class-level scope with
a static modifier (for example, is Class Used). No other variables can have a
static modifier attached to them. Because these variables are defined with
the static modifier, there would always be a single copy of these variables no matter how
many times the class has been instantiated. They live as long as the class is loaded in
memory.
 Parameters or Arguments: These are variables passed into a method signature (for
example, parameter). Recall the usage of the args variable in the main method. They are
not attached to modifiers (i.e. public, private, protected or static) and they can be used
everywhere in the method. They are in memory during the execution of the method and
can't be used after the method returns.
 Local variables: These variables are defined and used specifically within the method-level
scope (for example, current Value) but not in the method signature. They do not have any
modifiers attached to it. They no longer exist after the method has returned.
OPERATORS
 Unary operators are those operators that
operate on a single variable, such as increment
and decrement (++), positive and negative signs
(+ –), the bit-wise NOT operator (~), the
logical NOT operator (!), parentheses, and the
new operator.
 Arithmetic operators are those operators used
in mathematical operations. Here it is important
to note that this table is read from left to right,
therefore multiplication and division have
greater precedence than addition and
subtraction.
 Assignment operators includes the familiar
assignment (=) operator as well as a set of
additional assignment operators referred to
generically as op= (operator equal). These new
operators are shortcut operators used when
performing an operation on a variable and
assigning the result back to that variable.
 Ternary operator is rarely used, and is mainly
inherited from Java's initial syntactical base
from C/C++. It is a somewhat cryptic shortcut,
but is perfectly legal
DECISION MAKING
If – The Conditional
 The if statement evaluates an expression and if that
evaluation is true then the specified action is taken
if ( x < 10 ) x = 10;
 If the value of x is less than 10, make x equal to 10
 It could have been written:
if ( x < 10 )
x = 10;
 Or, alternatively:
if ( x < 10 ) { x = 10; }
If… else
 The if … else statement evaluates an expression and performs one
action if that evaluation is true or a different action if it is false.
if (x != oldx) {
System.out.print(“x was changed”);
}
else {
System.out.print(“x is unchanged”);
}
Nested if … else
if ( myVal > 100 ) {
if ( remainderOn == true) {
myVal = mVal % 100;
}
else {
myVal = myVal / 100.0;
}
}
else
{
System.out.print(“myVal is in range”);
}
else if
 Useful for choosing between alternatives:
if ( n == 1 ) {
// execute code block #1
}
else if ( j == 2 ) {
// execute code block #2
}
else {
// if all previous tests have failed, execute code
block #3
}
A Warning…
WRONG!
if( i == j )
if ( j == k )
System.out.print(
“i equals k”);
else
System.out.print(
“i is not equal to j”);
CORRECT!
if( i == j ) {
if ( j == k )
System.out.print(
“i equals k”);
}
else
System.out.print(“i is not equal to j”); //
Correct!
 The switch Statement
switch ( n ) {
case 1:
// execute code block #1
break;
case 2:
// execute code block #2
break;
default:
// if all previous tests fail then
//execute code block #4
break;
}
The for loop
 Loop n times
for ( i = 0; i < n; n++ ) {
// this code body will execute n times
// ifrom 0 to n-1
}
 Nested for:
for ( j = 0; j < 10; j++ ) {
for ( i = 0; i < 20; i++ ){
// this code body will execute 200 times
}
 while loops
while(response == 1) {
System.out.print( “ID =” + userID[n]);
n++;
response = readInt( “Enter “);
}
do {… } while loops
do {
System.out.print( “ID =” + userID[n] );
n++;
response = readInt( “Enter ” );
}while (response == 1);
A break statement causes an exit from the innermost
containing while, do, for or switch statement.
for ( int i = 0; i < maxID, i++ ) {
if ( userID[i] == targetID ) {
index = i;
break;
}
} // program jumps here after break
Continue
 Can only be used with while, do or for.
 The continue statement causes the innermost loop to start the
next iteration immediately
for ( int i = 0; i < maxID; i++ ) {
if ( userID[i] != -1 ) continue;
System.out.print( “UserID ” + i + “ :” +
userID);
}
Javascript

More Related Content

PPTX
Knowledge of Javascript
PPT
Unit 5 Java
PPT
Java adapter
PPTX
Control structures in java
PDF
Python Programming - X. Exception Handling and Assertions
PPS
Control statements
PDF
Automated Refactoring of Legacy Java Software to Default Methods Talk at GMU
PPT
Strategy and Template Pattern
Knowledge of Javascript
Unit 5 Java
Java adapter
Control structures in java
Python Programming - X. Exception Handling and Assertions
Control statements
Automated Refactoring of Legacy Java Software to Default Methods Talk at GMU
Strategy and Template Pattern

What's hot (19)

PPT
9781439035665 ppt ch05
PDF
Java unit 11
PPTX
Operators in java
PPTX
Storage Classes and Functions
PPT
9781111530532 ppt ch05
PPTX
A (too) Short Introduction to Scala
PPTX
PPTX
Storage Class Specifiers in C++
PDF
Python Programming - III. Controlling the Flow
PPT
Annotations
PPT
Control statements in java programmng
PPT
Java findamentals1
PPT
Java findamentals1
PPT
Java findamentals1
PPT
Decision making and loop in C#
PDF
Towards Improving Interface Modularity in Legacy Java Software Through Automa...
PDF
Exception handling & logging in Java - Best Practices (Updated)
PPTX
Fundamentals of prog. by rubferd medina
PPTX
Storage classes in c language
9781439035665 ppt ch05
Java unit 11
Operators in java
Storage Classes and Functions
9781111530532 ppt ch05
A (too) Short Introduction to Scala
Storage Class Specifiers in C++
Python Programming - III. Controlling the Flow
Annotations
Control statements in java programmng
Java findamentals1
Java findamentals1
Java findamentals1
Decision making and loop in C#
Towards Improving Interface Modularity in Legacy Java Software Through Automa...
Exception handling & logging in Java - Best Practices (Updated)
Fundamentals of prog. by rubferd medina
Storage classes in c language
Ad

Similar to Javascript (20)

PPT
SMI - Introduction to Java
PDF
Proyect of english
PPTX
JAVA(module1).pptx
PPT
Intro Java Rev010
DOCX
Unit2 java
PPTX
brief introduction to core java programming.pptx
PDF
Understanding And Using Reflection
PPTX
Basics java programing
DOCX
Java 3 rd sem. 2012 aug.ASSIGNMENT
PDF
Bt0074 oops with java2
PDF
Java programming basics
PPT
Java_presesntation.ppt
PPTX
lecture 6
PPTX
Introduction to computer science
PPTX
Core Java introduction | Basics | free course
PDF
JavaScript Interview Questions PDF By ScholarHat
PPTX
Module--fundamentals and operators in java1.pptx
PPT
Unit I Advanced Java Programming Course
PPT
JAVA_BASICS_Data_abstraction_encapsulation.ppt
PPTX
Java history, versions, types of errors and exception, quiz
SMI - Introduction to Java
Proyect of english
JAVA(module1).pptx
Intro Java Rev010
Unit2 java
brief introduction to core java programming.pptx
Understanding And Using Reflection
Basics java programing
Java 3 rd sem. 2012 aug.ASSIGNMENT
Bt0074 oops with java2
Java programming basics
Java_presesntation.ppt
lecture 6
Introduction to computer science
Core Java introduction | Basics | free course
JavaScript Interview Questions PDF By ScholarHat
Module--fundamentals and operators in java1.pptx
Unit I Advanced Java Programming Course
JAVA_BASICS_Data_abstraction_encapsulation.ppt
Java history, versions, types of errors and exception, quiz
Ad

Recently uploaded (20)

PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Lesson notes of climatology university.
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
master seminar digital applications in india
PDF
RMMM.pdf make it easy to upload and study
PDF
Classroom Observation Tools for Teachers
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Cell Structure & Organelles in detailed.
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Final Presentation General Medicine 03-08-2024.pptx
Supply Chain Operations Speaking Notes -ICLT Program
TR - Agricultural Crops Production NC III.pdf
O5-L3 Freight Transport Ops (International) V1.pdf
Lesson notes of climatology university.
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
master seminar digital applications in india
RMMM.pdf make it easy to upload and study
Classroom Observation Tools for Teachers
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
human mycosis Human fungal infections are called human mycosis..pptx
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Abdominal Access Techniques with Prof. Dr. R K Mishra
Cell Structure & Organelles in detailed.
Anesthesia in Laparoscopic Surgery in India
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf

Javascript

  • 1. MADE BY: SHELDON ABRAHAM IX A 38
  • 2. INTRODUCTION  Java is a computer programming language that is concurrent, class based object-oriented , and specifically designed to have as few implementation dependencies as possible.  Java applications are typically compiled to byte code that can run on any Java virtual machine (JVM) regardless of computer architecture.
  • 3.  Java is, as of 2014, one of the most popular programming languages in use, particularly for client-server web applications, with a reported 9 million developers.  Java was originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java Platform.  The language derives much of its syntax from C and C++, but it has fewer low- level facilities than either of them.
  • 4. HISTORY  On 23 May 1995, John Gage, the director of the Science Office of the Sun Microsystems along with Marc Andreesen, co-founder and executive vice president at Netscape announced to an audience of Sun World that Java technology wasn't a myth and that it was a reality and that it was going to be incorporated into Netscape Navigator.  At the time the total number of people working on Java was less than 30. This team would shape the future in the next decade and no one had any idea as to what was in store. From being the mind of an unmanned vehicle on Mars to the operating environment on most of the consumer electronics, e.g. cable set-top boxes, VCRs, toasters and also for personal digital assistants (PDAs). Java has come a long way from its inception. Let's see how it all began.
  • 5.  Before Java emerged as a programming language, C++ was the dominant player in the trade. The primary goals that the creators of Java was to create a language that could tackle most of the things that C++ offered while getting rid of some of the more tedious tasks that came with the earlier languages.  Behind closed doors, a project was initiated in December of 1990, whose aim was to create a programming tool that could render obsolete the C and C++ programming languages. Engineer Patrick Naughton had become extremely frustrated with the state of Sun's C++ and C APIs (Application Programming Interfaces) and tools.
  • 6. OBJECTIIVES There were five primary goals in the creation of the Java language.  It should be "simple, object-oriented and familiar"  It should be "robust and secure"  It should be "architecture-neutral and portable"  It should execute with "high performance"  It should be "interpreted, threaded, and
  • 7. PROPERTIES  Various features of java programming language are as given below-  1.Java is very simple programming language. Even though you have no  programming background you can learn this language comfortably.  2.Java is popular because it is an object oriented programming language like C++.  3.Platform independence is the most exciting feature of java. That means programs in java can be executed on variety of systems. This feature is based on the goal “write once, run anywhere and at anytime, forever”.  4.Java supports multithreaded programming which allows a programmer to write  such a program that can be perform many tasks simultaneously.  5.Thus robustness is the essential criteria for the java programs.  6.Java is designed for distributed systems. Hence two different objects on different
  • 8. VARIABLES There are four kinds of variables.  Instance variables: These are variables that are used to store the state of an object (for example, id). Every object created from a class definition would have its own copy of the variable. It is valid for and occupies storage for as long as the corresponding object is in memory.  Class variables: These variables are explicitly defined within the class-level scope with a static modifier (for example, is Class Used). No other variables can have a static modifier attached to them. Because these variables are defined with the static modifier, there would always be a single copy of these variables no matter how many times the class has been instantiated. They live as long as the class is loaded in memory.  Parameters or Arguments: These are variables passed into a method signature (for example, parameter). Recall the usage of the args variable in the main method. They are not attached to modifiers (i.e. public, private, protected or static) and they can be used everywhere in the method. They are in memory during the execution of the method and can't be used after the method returns.  Local variables: These variables are defined and used specifically within the method-level scope (for example, current Value) but not in the method signature. They do not have any modifiers attached to it. They no longer exist after the method has returned.
  • 9. OPERATORS  Unary operators are those operators that operate on a single variable, such as increment and decrement (++), positive and negative signs (+ –), the bit-wise NOT operator (~), the logical NOT operator (!), parentheses, and the new operator.  Arithmetic operators are those operators used in mathematical operations. Here it is important to note that this table is read from left to right, therefore multiplication and division have greater precedence than addition and subtraction.
  • 10.  Assignment operators includes the familiar assignment (=) operator as well as a set of additional assignment operators referred to generically as op= (operator equal). These new operators are shortcut operators used when performing an operation on a variable and assigning the result back to that variable.  Ternary operator is rarely used, and is mainly inherited from Java's initial syntactical base from C/C++. It is a somewhat cryptic shortcut, but is perfectly legal
  • 11. DECISION MAKING If – The Conditional  The if statement evaluates an expression and if that evaluation is true then the specified action is taken if ( x < 10 ) x = 10;  If the value of x is less than 10, make x equal to 10  It could have been written: if ( x < 10 ) x = 10;  Or, alternatively: if ( x < 10 ) { x = 10; }
  • 12. If… else  The if … else statement evaluates an expression and performs one action if that evaluation is true or a different action if it is false. if (x != oldx) { System.out.print(“x was changed”); } else { System.out.print(“x is unchanged”); } Nested if … else if ( myVal > 100 ) { if ( remainderOn == true) { myVal = mVal % 100; } else { myVal = myVal / 100.0; } } else { System.out.print(“myVal is in range”); }
  • 13. else if  Useful for choosing between alternatives: if ( n == 1 ) { // execute code block #1 } else if ( j == 2 ) { // execute code block #2 } else { // if all previous tests have failed, execute code block #3 }
  • 14. A Warning… WRONG! if( i == j ) if ( j == k ) System.out.print( “i equals k”); else System.out.print( “i is not equal to j”); CORRECT! if( i == j ) { if ( j == k ) System.out.print( “i equals k”); } else System.out.print(“i is not equal to j”); // Correct!
  • 15.  The switch Statement switch ( n ) { case 1: // execute code block #1 break; case 2: // execute code block #2 break; default: // if all previous tests fail then //execute code block #4 break; }
  • 16. The for loop  Loop n times for ( i = 0; i < n; n++ ) { // this code body will execute n times // ifrom 0 to n-1 }  Nested for: for ( j = 0; j < 10; j++ ) { for ( i = 0; i < 20; i++ ){ // this code body will execute 200 times }  while loops while(response == 1) { System.out.print( “ID =” + userID[n]); n++; response = readInt( “Enter “); }
  • 17. do {… } while loops do { System.out.print( “ID =” + userID[n] ); n++; response = readInt( “Enter ” ); }while (response == 1); A break statement causes an exit from the innermost containing while, do, for or switch statement. for ( int i = 0; i < maxID, i++ ) { if ( userID[i] == targetID ) { index = i; break; } } // program jumps here after break
  • 18. Continue  Can only be used with while, do or for.  The continue statement causes the innermost loop to start the next iteration immediately for ( int i = 0; i < maxID; i++ ) { if ( userID[i] != -1 ) continue; System.out.print( “UserID ” + i + “ :” + userID); }