SlideShare a Scribd company logo
JAVA 
BASIC TERMS TO BE KNOWN…..
Facts and history 
Who invented java? 
James Gosling 
Where? 
Sun lab also known as sun micro 
system. 
When? 
Around 1992, published in 1995. 
What is first name at a time of invention? 
“oak”, from the name of tree outside 
the window of James.
Facts and history 
Why the name “java” and the symbol a “coffee cup”? 
Some issues with the name “oak”. 
Seating in the local café. 
Wounded up with the name “java”. 
From the cup of coffee. 
What is the relation with c/c++? 
Java was created as a successor to C++ in order 
to address various problems of that language
Features of java 
Compiled and interpreted 
 Source code  byte code and byte code  machine code 
 Platform independent and portable 
 Can be run on any platform 
 Secure 
 Ensures that no virus is communicated with applet 
 Distributed 
 Multiple programmers at different remote locations can collaborate and work together 
 High performance 
 Faster execution speed 
 Multi language supported 
Dynamic and extensible 
New class library, classes and methods can be linked dynamically
JIT, Jvm, jre and jdk 
 JIT 
 Just-In-Time 
 Component of JRE 
 Improves the performance 
 JVM 
 Provides runtime environment in which java byte 
code is executed. 
 Compilation + interpretation 
 Not physically present 
 JRE 
 Runtime environment 
 Implementation of JVM 
 Contains a libraries + other files 
 JDK 
 JRE + development tools 
 Bundle of softwares
Different versions 
 JDK 1.0 (January 21, 1996) 
 JDK 1.1 (February 19, 1997) 
 J2SE 1.2 (December 8, 1998) 
 J2SE 1.3 (May 8, 2000) 
 J2SE 1.4 (February 6, 2002) 
 J2SE 5.0 (September 30, 2004) 
 Java SE 6 (December 11, 2006) 
 Java SE 7 (July 28, 2011) 
 Java SE 8 (March 18, 2014)
Advantages over c/c++ 
 Improved software maintainability 
 Faster development 
 Lower cost of development 
 Higher quality software 
 Use of notepad makes it easier 
 Supports method overloading and overriding 
 Errors can be handled with the use of Exception 
 Automatic garbage collection
STARTING THE BASICS… 
File name: Abc.java 
Code: 
class abc 
{ 
public static void main(String args[]) 
{ 
System.out.print("hello, how are you all??"); 
} 
}
Meaning of each term 
Public: visibility mode 
Static: to use without creating object 
Void: return type 
String: pre-defined class 
Args: array name 
System: pre-defined class 
Out: object 
Print: method 
Make sure: 
 No need of saving file with initial capital 
letter 
 File name can be saved with the different 
name of class name
String to integer and double 
class conv 
{ 
public static void main(String a[]) 
{ 
int a; 
String b="1921"; 
double c; 
a=Integer.parseInt(b); 
System.out.println(a); 
c=Double.parseDouble(b); 
System.out.println(c); 
} 
}
Final variable 
Value that will be constant through out the program. 
 Can not assign another value. 
 Study following program. 
class fin 
{ 
public static void main(String a[]) 
{ 
final int a=9974; 
System.out.print(a); 
a=759; 
System.out.print(a); 
} 
}
Errors and exception 
What is the difference??? 
Errors 
Something that make a program go wrong. 
 Can give unexpected result. 
Types: 
Compile-time errors 
 Run-time errors 
Exception 
 Condition that is caused by a run-rime error in the program. 
 Ex. Dividing by zero. 
 Interpreter creates an exception object and throws it.
errors 
Compile-time Error 
 Occurs at the time of compilation. 
 Syntax errors 
 Detected and displayed by the interpreter. 
 .class file will not be created 
 For successful compilation it need to be fixed. 
 For ex. Missing semicolon or missing brackets.
More examples 
 Misspelling of identifier or keyword 
 Missing double quotes in string 
 Use of undeclared variable 
 Use of = in place of == operator 
 Path not found 
Changing the value of variable which is declared final
errors 
Run-time Error 
 Program compile successfully 
 Class file also generated. 
 Though may not run successfully 
 Or may produce wrong o/p due to wrong logic 
 Error message generated 
 Program aborted 
 For ex. Divide by zero.
More examples 
 Accessing an element that is out of bound of an array. 
Trying to store a value into an array of an incompatible class or type. 
 Passing a parameter that is not in a valid range. 
 Attempting to use a negative size for an array. 
 Converting invalid string to a number 
 Accessing a character that is out of bound of a string.
class Err 
{ 
public static void main(String bdnfs[]) 
{ 
int a=50,b=10,c=10; 
int result=a/(b-c); 
System.out.print(result); 
int res=a/(b+c); 
System.out.print(res); 
} 
} 
WHICH ONE IS THIS??
exception 
 Caused by run-time error in the program. 
 If it is not caught and handled properly, the interpreter will display an error message. 
 Ex. ArithmeticException 
ArrayIndexOutOfBoundException 
FileNotFoundException 
OutOfMemoryExcepion 
SecurityException 
StackOverFlowException
Exception HANDLING 
 In previous program , if we want to continue the execution with the remaining 
code, then we should try to catch the exception object thrown by error condition 
and then display an appropriate message for taking correct actions. 
 This task Is known as Exception Handling. 
 The purpose of this is to provide a means to detect and report circumstances. 
 So appropriate action can be taken 
 It contains 4 sub tasks. 
 Find the problem(Hit) 
 Inform that error has occurred(Throw) 
 Receive the error Information(Catch) 
Take corrective action(Handle)
Syntax 
…………………………. 
…………………………. 
Try 
{ 
statements; // generates an Exception 
} 
Catch (Exception-type e) 
{ 
statements; // processes the Exception 
} 
……………………….... 
…………………………
example 
class Err2 
{ 
public static void main(String bdnfs[]) 
{ 
int a=50,b=10,c=10; 
int result,res; 
try 
{ 
result=a/(b-c); 
} 
catch (ArithmeticException e) 
{ 
System.out.println("can not divided by zero "); 
} 
res=a/(b+c); 
System.out.print(res); 
} 
}
Multiple catch statements 
…………………………. 
…………………………. 
Try 
{ 
statements; // generates an Exception 
} 
Catch (Exception-type-1 e) 
{ 
statements; // processes the Exception type 1 
} 
Catch (Exception-type-2 e) 
{ 
statements; // processes the Exception type 2 
} 
. 
. 
. 
. 
Catch (Exception-type-N e) 
{ 
statements; // processes the Exception type N 
} 
……………………….... 
…………………………
Finally statement 
 Finally statement is supported by Java to handle a type of exception 
that is not handled by catch statement. 
 It may be immediately added after try block or after the last catch 
block. 
 Guaranteed to execute whether the exception Is thrown or not. 
 Can be used for performing certain house-keeping operation such a 
closing files and realizing system resources. 
 Syntax for using finally statement is shown in next slide.
Syntax 
Try 
{ 
………….. 
………….. 
} 
Catch (……….) 
{ 
………….. 
………….. 
} 
Finally 
{ 
………….. 
………….. 
} 
Decide according to 
program that 
whether to use catch 
block or not…
class Err3 
{ 
public static void main(String bdnfs[]) 
{ 
int a[]={50,100}; 
int x=5; 
try 
{ 
int p=a[2]/(x-a[0]); 
} 
finally 
{ 
int q=a[1]/a[0]; 
System.out.println(q); 
} 
} 
} 
example
Some puzzles.. 
String mesg = “Answer is “; int sum = 1 + 2; System.out.println(mesg + sum); 
 Output: “Answer is 3” 
int sum = 5; sum = sum + sum *5/2; System.out.println(sum); 
 Output: 17 
int limit = 25; int count = 30; int total = 200; count *=5; limit -=5; total +=count 
+ limit; System.out.println("total =" + total); 
 Output: 370 
String str1 = "Java"; String str2 = "Java program"; String str3 = "program"; 
char c = ' '; String s1 = str1 + str3; String s2 = str1 + "c"; String s3 = str1 + c; 
String s4 = “ “; s4 += str1; String s5 = s4 + str3; 
 Output: “Javac”
References 
 http://darwinsys.com/java/javaTopTen.html 
 http://www.funtrivia.com/en/subtopics/javao-programming-204270.html 
 http://cs-fundamentals.com/java-programming/difference-between-jdk-jre-jvm-jit. 
php 
 http://www.javabeat.net/what-is-the-difference-between-jrejvm-and-jdk/ 
 http://www.fixoncloud.com/Home/LoginValidate/OneProblemComplete_Detailed.p 
hp?problemid=535
Prepred by: 
Saurabh Prajapati(11ce21)

More Related Content

What's hot

Introduction to fragments in android
Introduction to fragments in androidIntroduction to fragments in android
Introduction to fragments in android
Prawesh Shrestha
 
oops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaoops concept in java | object oriented programming in java
oops concept in java | object oriented programming in java
CPD INDIA
 
Use Node.js to create a REST API
Use Node.js to create a REST APIUse Node.js to create a REST API
Use Node.js to create a REST API
Fabien Vauchelles
 
Java features
Java featuresJava features
Java features
Prashant Gajendra
 
Java web application development
Java web application developmentJava web application development
Java web application development
RitikRathaur
 
Java swing
Java swingJava swing
Java swing
Apurbo Datta
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
Amit Tyagi
 
JavaScript Tutorial
JavaScript  TutorialJavaScript  Tutorial
JavaScript Tutorial
Bui Kiet
 
JAVA ENVIRONMENT
JAVA  ENVIRONMENTJAVA  ENVIRONMENT
JAVA ENVIRONMENT
josemachoco
 
Introduction to spring boot
Introduction to spring bootIntroduction to spring boot
Introduction to spring boot
Santosh Kumar Kar
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentationguest11106b
 
Android Components
Android ComponentsAndroid Components
Android Components
Aatul Palandurkar
 
Java 8 features
Java 8 featuresJava 8 features
Java 8 features
NexThoughts Technologies
 
Database in Android
Database in AndroidDatabase in Android
Database in Android
MaryadelMar85
 
Introduction to Eclipse IDE
Introduction to Eclipse IDEIntroduction to Eclipse IDE
Introduction to Eclipse IDE
Muhammad Hafiz Hasan
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
Sandeep Rawat
 

What's hot (20)

Introduction to fragments in android
Introduction to fragments in androidIntroduction to fragments in android
Introduction to fragments in android
 
oops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaoops concept in java | object oriented programming in java
oops concept in java | object oriented programming in java
 
Use Node.js to create a REST API
Use Node.js to create a REST APIUse Node.js to create a REST API
Use Node.js to create a REST API
 
Java features
Java featuresJava features
Java features
 
Java web application development
Java web application developmentJava web application development
Java web application development
 
Java swing
Java swingJava swing
Java swing
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
 
JavaScript Tutorial
JavaScript  TutorialJavaScript  Tutorial
JavaScript Tutorial
 
JAVA ENVIRONMENT
JAVA  ENVIRONMENTJAVA  ENVIRONMENT
JAVA ENVIRONMENT
 
Generics
GenericsGenerics
Generics
 
Introduction to spring boot
Introduction to spring bootIntroduction to spring boot
Introduction to spring boot
 
Spring Data JPA
Spring Data JPASpring Data JPA
Spring Data JPA
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentation
 
Oops concept on c#
Oops concept on c#Oops concept on c#
Oops concept on c#
 
Android Components
Android ComponentsAndroid Components
Android Components
 
Java 8 features
Java 8 featuresJava 8 features
Java 8 features
 
Introduction to Angularjs
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs
 
Database in Android
Database in AndroidDatabase in Android
Database in Android
 
Introduction to Eclipse IDE
Introduction to Eclipse IDEIntroduction to Eclipse IDE
Introduction to Eclipse IDE
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 

Viewers also liked

History of java
History of javaHistory of java
History of java
Mani Sarkar
 
History of Java 1/2
History of Java 1/2History of Java 1/2
History of Java 1/2
Eberhard Wolff
 
Turing machine-TOC
Turing machine-TOCTuring machine-TOC
Turing machine-TOC
Maulik Togadiya
 
remote sensor
remote sensorremote sensor
remote sensor
SAurabh PRajapati
 
Data mining
Data miningData mining
Data mining
Maulik Togadiya
 
12. dfs
12. dfs12. dfs
6. The grid-COMPUTING OGSA and WSRF
6. The grid-COMPUTING OGSA and WSRF6. The grid-COMPUTING OGSA and WSRF
6. The grid-COMPUTING OGSA and WSRF
Dr Sandeep Kumar Poonia
 
Distributed file system
Distributed file systemDistributed file system
Distributed file system
Anamika Singh
 
Ccleaner presentation
Ccleaner presentationCcleaner presentation
Ccleaner presentation
SAurabh PRajapati
 
Multiple Access in wireless communication
Multiple Access in wireless communicationMultiple Access in wireless communication
Multiple Access in wireless communication
Maulik Togadiya
 
optimization of DFA
optimization of DFAoptimization of DFA
optimization of DFA
Maulik Togadiya
 
Distributed shred memory architecture
Distributed shred memory architectureDistributed shred memory architecture
Distributed shred memory architecture
Maulik Togadiya
 
Distributed computing
Distributed computingDistributed computing
Distributed computing
Deepak John
 
IDS n IPS
IDS n IPSIDS n IPS
Soft computing
Soft computingSoft computing
Soft computing
Dr Sandeep Kumar Poonia
 
Light emitting Diode
Light emitting DiodeLight emitting Diode
Light emitting Diode
SAurabh PRajapati
 

Viewers also liked (20)

History of java
History of javaHistory of java
History of java
 
History of Java 1/2
History of Java 1/2History of Java 1/2
History of Java 1/2
 
Evolution Of Java
Evolution Of JavaEvolution Of Java
Evolution Of Java
 
Turing machine-TOC
Turing machine-TOCTuring machine-TOC
Turing machine-TOC
 
Ip sec
Ip secIp sec
Ip sec
 
remote sensor
remote sensorremote sensor
remote sensor
 
Data mining
Data miningData mining
Data mining
 
12. dfs
12. dfs12. dfs
12. dfs
 
6. The grid-COMPUTING OGSA and WSRF
6. The grid-COMPUTING OGSA and WSRF6. The grid-COMPUTING OGSA and WSRF
6. The grid-COMPUTING OGSA and WSRF
 
Distributed file system
Distributed file systemDistributed file system
Distributed file system
 
Distributed Operating System_2
Distributed Operating System_2Distributed Operating System_2
Distributed Operating System_2
 
Ccleaner presentation
Ccleaner presentationCcleaner presentation
Ccleaner presentation
 
Lecture28 tsp
Lecture28 tspLecture28 tsp
Lecture28 tsp
 
Multiple Access in wireless communication
Multiple Access in wireless communicationMultiple Access in wireless communication
Multiple Access in wireless communication
 
optimization of DFA
optimization of DFAoptimization of DFA
optimization of DFA
 
Distributed shred memory architecture
Distributed shred memory architectureDistributed shred memory architecture
Distributed shred memory architecture
 
Distributed computing
Distributed computingDistributed computing
Distributed computing
 
IDS n IPS
IDS n IPSIDS n IPS
IDS n IPS
 
Soft computing
Soft computingSoft computing
Soft computing
 
Light emitting Diode
Light emitting DiodeLight emitting Diode
Light emitting Diode
 

Similar to Java history, versions, types of errors and exception, quiz

Java programming basics
Java programming basicsJava programming basics
Java programming basics
Hamid Ghorbani
 
CLR Exception Handing And Memory Management
CLR Exception Handing And Memory ManagementCLR Exception Handing And Memory Management
CLR Exception Handing And Memory Management
Shiny Zhu
 
Introduction
IntroductionIntroduction
Introduction
richsoden
 
Javascript
JavascriptJavascript
Javascript
Sheldon Abraham
 
Java cheat sheet
Java cheat sheet Java cheat sheet
Java cheat sheet
Saifur Rahman
 
Java: Exception
Java: ExceptionJava: Exception
Java: Exception
Tareq Hasan
 
Exceptions overview
Exceptions overviewExceptions overview
Exceptions overview
Bharath K
 
java intro.pptx.pdf
java intro.pptx.pdfjava intro.pptx.pdf
java intro.pptx.pdf
TekobashiCarlo
 
Java -Exception handlingunit-iv
Java -Exception handlingunit-ivJava -Exception handlingunit-iv
Java -Exception handlingunit-iv
RubaNagarajan
 
java basic for begginers
java basic for begginersjava basic for begginers
java basic for begginers
divaskrgupta007
 
Adv java unit 1 M.Sc CS.pdf
Adv java unit 1 M.Sc CS.pdfAdv java unit 1 M.Sc CS.pdf
Adv java unit 1 M.Sc CS.pdf
KALAISELVI P
 
Intro Java Rev010
Intro Java Rev010Intro Java Rev010
Intro Java Rev010Rich Helton
 
Advance java kvr -satya
Advance java  kvr -satyaAdvance java  kvr -satya
Advance java kvr -satya
Satya Johnny
 
Adv kvr -satya
Adv  kvr -satyaAdv  kvr -satya
Adv kvr -satya
Jyothsna Sree
 
Classes and Objects
Classes and ObjectsClasses and Objects
Classes and Objects
vmadan89
 
01-ch01-1-println.ppt java introduction one
01-ch01-1-println.ppt java introduction one01-ch01-1-println.ppt java introduction one
01-ch01-1-println.ppt java introduction one
ssuser656672
 
Chapter 2.1
Chapter 2.1Chapter 2.1
Chapter 2.1sotlsoc
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller Columns
Jonathan Fine
 
Java platform
Java platformJava platform
Java platform
BG Java EE Course
 

Similar to Java history, versions, types of errors and exception, quiz (20)

Java programming basics
Java programming basicsJava programming basics
Java programming basics
 
CLR Exception Handing And Memory Management
CLR Exception Handing And Memory ManagementCLR Exception Handing And Memory Management
CLR Exception Handing And Memory Management
 
Introduction
IntroductionIntroduction
Introduction
 
Javascript
JavascriptJavascript
Javascript
 
Java cheat sheet
Java cheat sheet Java cheat sheet
Java cheat sheet
 
Java: Exception
Java: ExceptionJava: Exception
Java: Exception
 
Exceptions overview
Exceptions overviewExceptions overview
Exceptions overview
 
java intro.pptx.pdf
java intro.pptx.pdfjava intro.pptx.pdf
java intro.pptx.pdf
 
Java -Exception handlingunit-iv
Java -Exception handlingunit-ivJava -Exception handlingunit-iv
Java -Exception handlingunit-iv
 
java basic for begginers
java basic for begginersjava basic for begginers
java basic for begginers
 
Adv java unit 1 M.Sc CS.pdf
Adv java unit 1 M.Sc CS.pdfAdv java unit 1 M.Sc CS.pdf
Adv java unit 1 M.Sc CS.pdf
 
Intro Java Rev010
Intro Java Rev010Intro Java Rev010
Intro Java Rev010
 
Advance java kvr -satya
Advance java  kvr -satyaAdvance java  kvr -satya
Advance java kvr -satya
 
Adv kvr -satya
Adv  kvr -satyaAdv  kvr -satya
Adv kvr -satya
 
Classes and Objects
Classes and ObjectsClasses and Objects
Classes and Objects
 
01-ch01-1-println.ppt java introduction one
01-ch01-1-println.ppt java introduction one01-ch01-1-println.ppt java introduction one
01-ch01-1-println.ppt java introduction one
 
Java
JavaJava
Java
 
Chapter 2.1
Chapter 2.1Chapter 2.1
Chapter 2.1
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller Columns
 
Java platform
Java platformJava platform
Java platform
 

Recently uploaded

Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
NelTorrente
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
Bisnar Chase Personal Injury Attorneys
 
What is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptxWhat is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptx
christianmathematics
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Ashish Kohli
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 

Recently uploaded (20)

Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
 
What is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptxWhat is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptx
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 

Java history, versions, types of errors and exception, quiz

  • 1. JAVA BASIC TERMS TO BE KNOWN…..
  • 2. Facts and history Who invented java? James Gosling Where? Sun lab also known as sun micro system. When? Around 1992, published in 1995. What is first name at a time of invention? “oak”, from the name of tree outside the window of James.
  • 3. Facts and history Why the name “java” and the symbol a “coffee cup”? Some issues with the name “oak”. Seating in the local café. Wounded up with the name “java”. From the cup of coffee. What is the relation with c/c++? Java was created as a successor to C++ in order to address various problems of that language
  • 4. Features of java Compiled and interpreted  Source code  byte code and byte code  machine code  Platform independent and portable  Can be run on any platform  Secure  Ensures that no virus is communicated with applet  Distributed  Multiple programmers at different remote locations can collaborate and work together  High performance  Faster execution speed  Multi language supported Dynamic and extensible New class library, classes and methods can be linked dynamically
  • 5. JIT, Jvm, jre and jdk  JIT  Just-In-Time  Component of JRE  Improves the performance  JVM  Provides runtime environment in which java byte code is executed.  Compilation + interpretation  Not physically present  JRE  Runtime environment  Implementation of JVM  Contains a libraries + other files  JDK  JRE + development tools  Bundle of softwares
  • 6. Different versions  JDK 1.0 (January 21, 1996)  JDK 1.1 (February 19, 1997)  J2SE 1.2 (December 8, 1998)  J2SE 1.3 (May 8, 2000)  J2SE 1.4 (February 6, 2002)  J2SE 5.0 (September 30, 2004)  Java SE 6 (December 11, 2006)  Java SE 7 (July 28, 2011)  Java SE 8 (March 18, 2014)
  • 7. Advantages over c/c++  Improved software maintainability  Faster development  Lower cost of development  Higher quality software  Use of notepad makes it easier  Supports method overloading and overriding  Errors can be handled with the use of Exception  Automatic garbage collection
  • 8. STARTING THE BASICS… File name: Abc.java Code: class abc { public static void main(String args[]) { System.out.print("hello, how are you all??"); } }
  • 9. Meaning of each term Public: visibility mode Static: to use without creating object Void: return type String: pre-defined class Args: array name System: pre-defined class Out: object Print: method Make sure:  No need of saving file with initial capital letter  File name can be saved with the different name of class name
  • 10. String to integer and double class conv { public static void main(String a[]) { int a; String b="1921"; double c; a=Integer.parseInt(b); System.out.println(a); c=Double.parseDouble(b); System.out.println(c); } }
  • 11. Final variable Value that will be constant through out the program.  Can not assign another value.  Study following program. class fin { public static void main(String a[]) { final int a=9974; System.out.print(a); a=759; System.out.print(a); } }
  • 12. Errors and exception What is the difference??? Errors Something that make a program go wrong.  Can give unexpected result. Types: Compile-time errors  Run-time errors Exception  Condition that is caused by a run-rime error in the program.  Ex. Dividing by zero.  Interpreter creates an exception object and throws it.
  • 13. errors Compile-time Error  Occurs at the time of compilation.  Syntax errors  Detected and displayed by the interpreter.  .class file will not be created  For successful compilation it need to be fixed.  For ex. Missing semicolon or missing brackets.
  • 14. More examples  Misspelling of identifier or keyword  Missing double quotes in string  Use of undeclared variable  Use of = in place of == operator  Path not found Changing the value of variable which is declared final
  • 15. errors Run-time Error  Program compile successfully  Class file also generated.  Though may not run successfully  Or may produce wrong o/p due to wrong logic  Error message generated  Program aborted  For ex. Divide by zero.
  • 16. More examples  Accessing an element that is out of bound of an array. Trying to store a value into an array of an incompatible class or type.  Passing a parameter that is not in a valid range.  Attempting to use a negative size for an array.  Converting invalid string to a number  Accessing a character that is out of bound of a string.
  • 17. class Err { public static void main(String bdnfs[]) { int a=50,b=10,c=10; int result=a/(b-c); System.out.print(result); int res=a/(b+c); System.out.print(res); } } WHICH ONE IS THIS??
  • 18. exception  Caused by run-time error in the program.  If it is not caught and handled properly, the interpreter will display an error message.  Ex. ArithmeticException ArrayIndexOutOfBoundException FileNotFoundException OutOfMemoryExcepion SecurityException StackOverFlowException
  • 19. Exception HANDLING  In previous program , if we want to continue the execution with the remaining code, then we should try to catch the exception object thrown by error condition and then display an appropriate message for taking correct actions.  This task Is known as Exception Handling.  The purpose of this is to provide a means to detect and report circumstances.  So appropriate action can be taken  It contains 4 sub tasks.  Find the problem(Hit)  Inform that error has occurred(Throw)  Receive the error Information(Catch) Take corrective action(Handle)
  • 20. Syntax …………………………. …………………………. Try { statements; // generates an Exception } Catch (Exception-type e) { statements; // processes the Exception } ……………………….... …………………………
  • 21. example class Err2 { public static void main(String bdnfs[]) { int a=50,b=10,c=10; int result,res; try { result=a/(b-c); } catch (ArithmeticException e) { System.out.println("can not divided by zero "); } res=a/(b+c); System.out.print(res); } }
  • 22. Multiple catch statements …………………………. …………………………. Try { statements; // generates an Exception } Catch (Exception-type-1 e) { statements; // processes the Exception type 1 } Catch (Exception-type-2 e) { statements; // processes the Exception type 2 } . . . . Catch (Exception-type-N e) { statements; // processes the Exception type N } ……………………….... …………………………
  • 23. Finally statement  Finally statement is supported by Java to handle a type of exception that is not handled by catch statement.  It may be immediately added after try block or after the last catch block.  Guaranteed to execute whether the exception Is thrown or not.  Can be used for performing certain house-keeping operation such a closing files and realizing system resources.  Syntax for using finally statement is shown in next slide.
  • 24. Syntax Try { ………….. ………….. } Catch (……….) { ………….. ………….. } Finally { ………….. ………….. } Decide according to program that whether to use catch block or not…
  • 25. class Err3 { public static void main(String bdnfs[]) { int a[]={50,100}; int x=5; try { int p=a[2]/(x-a[0]); } finally { int q=a[1]/a[0]; System.out.println(q); } } } example
  • 26. Some puzzles.. String mesg = “Answer is “; int sum = 1 + 2; System.out.println(mesg + sum);  Output: “Answer is 3” int sum = 5; sum = sum + sum *5/2; System.out.println(sum);  Output: 17 int limit = 25; int count = 30; int total = 200; count *=5; limit -=5; total +=count + limit; System.out.println("total =" + total);  Output: 370 String str1 = "Java"; String str2 = "Java program"; String str3 = "program"; char c = ' '; String s1 = str1 + str3; String s2 = str1 + "c"; String s3 = str1 + c; String s4 = “ “; s4 += str1; String s5 = s4 + str3;  Output: “Javac”
  • 27. References  http://darwinsys.com/java/javaTopTen.html  http://www.funtrivia.com/en/subtopics/javao-programming-204270.html  http://cs-fundamentals.com/java-programming/difference-between-jdk-jre-jvm-jit. php  http://www.javabeat.net/what-is-the-difference-between-jrejvm-and-jdk/  http://www.fixoncloud.com/Home/LoginValidate/OneProblemComplete_Detailed.p hp?problemid=535
  • 28. Prepred by: Saurabh Prajapati(11ce21)

Editor's Notes

  1. Ask that will the program give me output?? Then explain that its not necessary of saving the programs with same name as class.
  2. Another visibility modes, return type, array name can b anything, another objects, methods