SlideShare a Scribd company logo
Core Java    - Sharad Ballepu [email_address] www.sharmanj.com
Servlets & JSPs ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Core Java
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Introduction – What is Java
Introduction – Java Virtual Machine .class  file Java Virtual Machine .java file Java  Compiler UNIX Microsoft Mac
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Introduction – My First Program Version 1
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Introduction – My First Program Version 2
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Introduction – My First Program Version 3
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Introduction – My First Program Version 4
Introduction – Java Keywords throw this synchronized switch super strictfp static short return public protected private package new char catch case byte break boolean abstract volatile interface for do void int float default assert while try transient throws native long instanceof import implements if goto finally final extends else double continue const class
Introduction – Stack v/s Heap x = 10  y = new A() method2() method1() main() Stack ,[object Object],A B C
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Introduction - Object Oriented Concepts
Introduction - Data Types General rule: Min value = 2 (bits – 1) Max value = 2 (bits-1)  – 1 (where 1 byte = 8 bits) true, false - - -  boolean 2 16  – 1 - - 2 63  – 1 2 31  – 1 2 15  – 1 2 7  – 1 Max Value ‘ a’, ‘’ 123.86 1.0 123456 12345, 086, 0x675 1234 123 Literal Values - 8 double 0 2 char - 4 float -2 63 8 long Min Value Bytes Data type -2 31 4 int -2 15 2 short -2 7 1 byte
Java Modifiers static volatile native synchronized transient strictfp abstract final default protected private public Modifier Method Variables Methods Class Variables Class
Modifiers – Class ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Modifiers – Class Attributes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Operators - Types
[object Object],[object Object],Operators – Assignment Operators/Arithmetic Operators Assignment Description int i = 10; int j = i; Example = Operator int i = 10 / 2; Division / int i = 8 * 6; Multiplication *  int i = 10 % 3; Remainder % int i = 9 – 4; Subtraction - int i = 8 + 9; byte b = (byte) 5+4; Addition + Description Example Operator
[object Object],Operators – Unary Operators/Equality Operators ,[object Object],boolean j = !true; Logical Not ! int j = i--; Decrement -- int j = i++;  Increment ++ int i = -1; Unary minus - Unary plus Description int i = +1; Example + Operator If (i != 4) Non equality != If (i==1) Equality == Description Example Operator
[object Object],Operators – Relational Operators/Conditional Operators ,[object Object],if ( x <= 4) Less than or equal to <= if ( x >= 4) Greater than or equal to >= if ( x < 4) Less than < Greater than Description if ( x > 4) Example > Operator If (a == 4 || b == 5) Conditional or || If (a == 4 && b == 5) Conditional and && Description Example Operator
[object Object],Operators – instanceof Operator/Bitwise Operators/shift operators ,[object Object],[object Object],Instamce of Description If (john instance of person) Example instanceof Operator ~011 = -10 Reverse ~ 001 ^ 110 = 111 Bitwise ex-or ^ 001 | 110 = 111 Bitwise or | 001 & 111 =  1  Bitwise and & Description Example Operator 4 >>> 1 = 100 >>> 1 = 010 = 2 Unsigned Right shift >>> 4 << 1 = 100 << 1 = 1000 = 8 Left Shift << 4 >> 1 = 100 >> 1 =  010 = 2 Right shift >> Description Example Operator
[object Object],Flow Control – if-else if-else int a = 10; if (a < 10 ) { System.out.println(“Less than 10”); } else if (a > 10)  { System.out.pritln(“Greater than 10”); }  else  { System.out.println(“Equal to 10”); } Result: Equal to 10s if (<condition-1>)  { // logic for true condition-1 goes here } else if (<condition-2>)  { // logic for true condition-2 goes here } else  { // if no condition is met, control comes here } Example Syntax
Flow Control – switch ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Example Syntax
[object Object],Flow Control – do-while / while  ,[object Object],int i = 0; do  { System.out.println(“In do”);  i++; }  while ( i < 10); Result: Prints “In do” 11 times do { // stmt-1 }  while (<condition>); Example Syntax int i = 0; while ( i < 10 )  { System.out.println(“In while”);  i++; } Result: “In while” 10 times while (<condition>)  { //stmt } Example Syntax
[object Object],Flow Control – for loop  for (int i = 0; i < 10; i++) { System.out.println(“In for”); }  Result: Prints “In do” 10 times for ( initialize; condition; expression) { // stmt } Example Syntax
Arrays and Strings – Arrays Declaration/Construction/Initialization ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],1 2 9 7 5 0 7 5 3 2 8 1
Arrays and Strings – Arrays Representation myArray int[ ] myArray =  {1,2,3,4,5} Heap 5 4 3 2 1
[object Object],Arrays and Strings – Strings String myStr1 = new String(“abc”); String myStr2 = “abc”; ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],abc String Constant Pool
[object Object],[object Object],[object Object],[object Object],Constructors ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Employee emp = new Employee()
[object Object],OOPS Explored - Abstraction ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
OOPS Explored - Encapsulation My YouTube videos My Cute  puppy My Wedding  Gift My YouTube videos My Cute  puppy My Wedding  Gift My YouTube videos My Cute  cat My Hawaii  trip I can share my puppy video with everyone I want to share my wedding gift only with my friends
[object Object],[object Object],OOPS Explored - Encapsulation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],OOPS Explored - Inheritance Inherit the features of the superclass ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],OOPS Explored - Polymorphism One name, many forms ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
OOPS Explored – Polymorphism - Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],s4 S3 s2 s1 shape square
Exceptions – Exception Hierarchy Throwable Exception Error Unchecked  Exception Checked  Exception
Exceptions – Handling exceptions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions – Handling exceptions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions – try-catch-finally flow Put exception code in try  More exceptions To handle? Handle exceptions In catch? Execute finally? END   Handle exception In the catch block Clean-up code  in finally   yes yes yes no no no
Garbage Collection
Garbage Collection ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Garbage Collection A1 A2 A a = new A(); a.Name = ‘A1’; a = A2; A1 A a = new A(); a = null; A C B Reassign Reference Set null Islands Of Isolation
Collections - Introduction String student1 = “a”; String student2 = “b”; String student3 = “c”; String student4 = “d”; String student5 = “e”; String student6 = “f”; ,[object Object],[object Object],[object Object]
Collections – Arrays v/s Collections abc def jkl ghi abc 123 def new Person() Arrays Collections
Collections - Overview LinkedHashSet
Collections – Collection types ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],Collections – Lists ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],Collections – Set ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Collections – Map ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Threads - Introduction ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],main() method1() thread1.start() thread1.run()
Threads - Introduction TIME User validation Process report maintenance TIME User validation Process report maintenance EXECUTION EXECUTION Multi-threaded environment
Threads - Creation public Class MyThread implements Runnable  { public void run()  { System.out.println(“In Thread”); } }  To Invoke: MyThread t1 = new MyThread(); Thread t = new Thread(t1); t.Start(); public Class MyThread extends Thread  { public void run()  { System.out.println(“In Thread”); } }  To Invoke: MyThread t1 = new MyThread(); t1.start(); Implementing the Runnable Interface Extending the Thread Class
Threads – Thread Life cycle runnable end blocked start running T1 T2 T1 T2 T1 T2 T1 T1 T2
Threads – Important Methods ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Threads – Synchronization Account Account acct = getAccount (123); MyThread t1 = new MyThread(acct); MyThread t2 = new MyThread(acct); t1.start(); t2.start(); shared object public class Account { private int bal;  private int acctId; … public Account(int acctId)  { this.acctId = acctId; } public boolean withdraw(int amt)  { if (bal > 0)  { // give money // other related activities  bal = bal – amt; } } } run() run() T1 stack T2 stack acct acct 100  140 50 100 90 100
DEMO

More Related Content

What's hot

Arquitetura Node com NestJS
Arquitetura Node com NestJSArquitetura Node com NestJS
Arquitetura Node com NestJS
Vanessa Me Tonini
 
Spring Boot
Spring BootSpring Boot
Spring Boot
Jiayun Zhou
 
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B KuteChapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
Tushar B Kute
 
jQuery
jQueryjQuery
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot Introduction
Jeevesh Pandey
 
Java Collections Framework
Java Collections FrameworkJava Collections Framework
Java Collections Framework
Sony India Software Center
 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
Naz Abdalla
 
Java Introduction
Java IntroductionJava Introduction
Java Introduction
sunmitraeducation
 
Class and Objects in Java
Class and Objects in JavaClass and Objects in Java
Class and Objects in Java
Spotle.ai
 
Spring Boot
Spring BootSpring Boot
Spring Boot
Jaran Flaath
 
Java Basic Oops Concept
Java Basic Oops ConceptJava Basic Oops Concept
Java Basic Oops Concept
atozknowledge .com
 
Threads in JAVA
Threads in JAVAThreads in JAVA
Java 8 Lambda and Streams
Java 8 Lambda and StreamsJava 8 Lambda and Streams
Java 8 Lambda and Streams
Venkata Naga Ravi
 
Json
JsonJson
Files in java
Files in javaFiles in java
Javascript functions
Javascript functionsJavascript functions
Javascript functions
Alaref Abushaala
 
Spring Boot
Spring BootSpring Boot
Spring Boot
koppenolski
 
Java Collections
Java  Collections Java  Collections
Py.test
Py.testPy.test
Py.test
soasme
 

What's hot (20)

Arquitetura Node com NestJS
Arquitetura Node com NestJSArquitetura Node com NestJS
Arquitetura Node com NestJS
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B KuteChapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
 
jQuery
jQueryjQuery
jQuery
 
Generics
GenericsGenerics
Generics
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot Introduction
 
Java Collections Framework
Java Collections FrameworkJava Collections Framework
Java Collections Framework
 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
 
Java Introduction
Java IntroductionJava Introduction
Java Introduction
 
Class and Objects in Java
Class and Objects in JavaClass and Objects in Java
Class and Objects in Java
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Java Basic Oops Concept
Java Basic Oops ConceptJava Basic Oops Concept
Java Basic Oops Concept
 
Threads in JAVA
Threads in JAVAThreads in JAVA
Threads in JAVA
 
Java 8 Lambda and Streams
Java 8 Lambda and StreamsJava 8 Lambda and Streams
Java 8 Lambda and Streams
 
Json
JsonJson
Json
 
Files in java
Files in javaFiles in java
Files in java
 
Javascript functions
Javascript functionsJavascript functions
Javascript functions
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Java Collections
Java  Collections Java  Collections
Java Collections
 
Py.test
Py.testPy.test
Py.test
 

Viewers also liked

Core Java
Core JavaCore Java
Core Java
Prakash Dimmita
 
Php peers
Php peersPhp peers
Php peers
Satya Johnny
 
Core Java introduction | Basics | free course
Core Java introduction | Basics | free course Core Java introduction | Basics | free course
Core Java introduction | Basics | free course
Kernel Training
 
Core java lessons
Core java lessonsCore java lessons
Core java lessons
vivek shah
 
Presentation on java
Presentation  on  javaPresentation  on  java
Presentation on java
shashi shekhar
 
Core Java Slides
Core Java SlidesCore Java Slides
Core Java Slides
Vinit Vyas
 

Viewers also liked (7)

Core Java
Core JavaCore Java
Core Java
 
Php peers
Php peersPhp peers
Php peers
 
Core Java introduction | Basics | free course
Core Java introduction | Basics | free course Core Java introduction | Basics | free course
Core Java introduction | Basics | free course
 
Core java lessons
Core java lessonsCore java lessons
Core java lessons
 
Presentation on java
Presentation  on  javaPresentation  on  java
Presentation on java
 
Java basic
Java basicJava basic
Java basic
 
Core Java Slides
Core Java SlidesCore Java Slides
Core Java Slides
 

Similar to Core java

Java Tutorial
Java TutorialJava Tutorial
Java Tutorial
ArnaldoCanelas
 
Java_Tutorial_Introduction_to_Core_java.ppt
Java_Tutorial_Introduction_to_Core_java.pptJava_Tutorial_Introduction_to_Core_java.ppt
Java_Tutorial_Introduction_to_Core_java.ppt
Govind Samleti
 
Java tut1
Java tut1Java tut1
Java tut1
Sumit Tambe
 
Java tut1 Coderdojo Cahersiveen
Java tut1 Coderdojo CahersiveenJava tut1 Coderdojo Cahersiveen
Java tut1 Coderdojo Cahersiveen
Graham Royce
 
Java tut1
Java tut1Java tut1
Java tut1
Sumit Tambe
 
Javatut1
Javatut1 Javatut1
Javatut1
desaigeeta
 
Java tut1
Java tut1Java tut1
Java tut1
Ajmal Khan
 
Tutorial java
Tutorial javaTutorial java
Tutorial java
Abdul Aziz
 
Java Tut1
Java Tut1Java Tut1
Java Tut1
guest5c8bd1
 
Synapseindia reviews.odp.
Synapseindia reviews.odp.Synapseindia reviews.odp.
Synapseindia reviews.odp.
Tarunsingh198
 
Lazy Java
Lazy JavaLazy Java
Lazy Java
J On The Beach
 
Lazy Java
Lazy JavaLazy Java
Lazy Java
Nicola Pedot
 
Mario Fusco - Lazy Java - Codemotion Milan 2018
Mario Fusco - Lazy Java - Codemotion Milan 2018Mario Fusco - Lazy Java - Codemotion Milan 2018
Mario Fusco - Lazy Java - Codemotion Milan 2018
Codemotion
 
Lazy java
Lazy javaLazy java
Lazy java
Mario Fusco
 
Java Tutorial | My Heart
Java Tutorial | My HeartJava Tutorial | My Heart
Java Tutorial | My Heart
Bui Kiet
 
SystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features SummarySystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features Summary
Amal Khailtash
 
Automated Unit Testing
Automated Unit TestingAutomated Unit Testing
Automated Unit Testing
Mike Lively
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to java
ciklum_ods
 

Similar to Core java (20)

Java Tutorial
Java TutorialJava Tutorial
Java Tutorial
 
Java_Tutorial_Introduction_to_Core_java.ppt
Java_Tutorial_Introduction_to_Core_java.pptJava_Tutorial_Introduction_to_Core_java.ppt
Java_Tutorial_Introduction_to_Core_java.ppt
 
Java tut1
Java tut1Java tut1
Java tut1
 
Java tut1 Coderdojo Cahersiveen
Java tut1 Coderdojo CahersiveenJava tut1 Coderdojo Cahersiveen
Java tut1 Coderdojo Cahersiveen
 
Java tut1
Java tut1Java tut1
Java tut1
 
Javatut1
Javatut1 Javatut1
Javatut1
 
Java tut1
Java tut1Java tut1
Java tut1
 
Java Tutorial
Java TutorialJava Tutorial
Java Tutorial
 
Tutorial java
Tutorial javaTutorial java
Tutorial java
 
Java Tut1
Java Tut1Java Tut1
Java Tut1
 
Synapseindia reviews.odp.
Synapseindia reviews.odp.Synapseindia reviews.odp.
Synapseindia reviews.odp.
 
Lazy Java
Lazy JavaLazy Java
Lazy Java
 
Lazy Java
Lazy JavaLazy Java
Lazy Java
 
Mario Fusco - Lazy Java - Codemotion Milan 2018
Mario Fusco - Lazy Java - Codemotion Milan 2018Mario Fusco - Lazy Java - Codemotion Milan 2018
Mario Fusco - Lazy Java - Codemotion Milan 2018
 
Lazy java
Lazy javaLazy java
Lazy java
 
Java Tutorial | My Heart
Java Tutorial | My HeartJava Tutorial | My Heart
Java Tutorial | My Heart
 
Java tutorials
Java tutorialsJava tutorials
Java tutorials
 
SystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features SummarySystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features Summary
 
Automated Unit Testing
Automated Unit TestingAutomated Unit Testing
Automated Unit Testing
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to java
 

Recently uploaded

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 

Recently uploaded (20)

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 

Core java

  • 1. Core Java - Sharad Ballepu [email_address] www.sharmanj.com
  • 2.
  • 3.
  • 4. Introduction – Java Virtual Machine .class file Java Virtual Machine .java file Java Compiler UNIX Microsoft Mac
  • 5.
  • 6.
  • 7.
  • 8.
  • 9. Introduction – Java Keywords throw this synchronized switch super strictfp static short return public protected private package new char catch case byte break boolean abstract volatile interface for do void int float default assert while try transient throws native long instanceof import implements if goto finally final extends else double continue const class
  • 10.
  • 11.
  • 12. Introduction - Data Types General rule: Min value = 2 (bits – 1) Max value = 2 (bits-1) – 1 (where 1 byte = 8 bits) true, false - - - boolean 2 16 – 1 - - 2 63 – 1 2 31 – 1 2 15 – 1 2 7 – 1 Max Value ‘ a’, ‘’ 123.86 1.0 123456 12345, 086, 0x675 1234 123 Literal Values - 8 double 0 2 char - 4 float -2 63 8 long Min Value Bytes Data type -2 31 4 int -2 15 2 short -2 7 1 byte
  • 13. Java Modifiers static volatile native synchronized transient strictfp abstract final default protected private public Modifier Method Variables Methods Class Variables Class
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27. Arrays and Strings – Arrays Representation myArray int[ ] myArray = {1,2,3,4,5} Heap 5 4 3 2 1
  • 28.
  • 29.
  • 30.
  • 31. OOPS Explored - Encapsulation My YouTube videos My Cute puppy My Wedding Gift My YouTube videos My Cute puppy My Wedding Gift My YouTube videos My Cute cat My Hawaii trip I can share my puppy video with everyone I want to share my wedding gift only with my friends
  • 32.
  • 33.
  • 34.
  • 35.
  • 36. Exceptions – Exception Hierarchy Throwable Exception Error Unchecked Exception Checked Exception
  • 37.
  • 38.
  • 39. Exceptions – try-catch-finally flow Put exception code in try More exceptions To handle? Handle exceptions In catch? Execute finally? END Handle exception In the catch block Clean-up code in finally yes yes yes no no no
  • 41.
  • 42. Garbage Collection A1 A2 A a = new A(); a.Name = ‘A1’; a = A2; A1 A a = new A(); a = null; A C B Reassign Reference Set null Islands Of Isolation
  • 43.
  • 44. Collections – Arrays v/s Collections abc def jkl ghi abc 123 def new Person() Arrays Collections
  • 45. Collections - Overview LinkedHashSet
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51. Threads - Introduction TIME User validation Process report maintenance TIME User validation Process report maintenance EXECUTION EXECUTION Multi-threaded environment
  • 52. Threads - Creation public Class MyThread implements Runnable { public void run() { System.out.println(“In Thread”); } } To Invoke: MyThread t1 = new MyThread(); Thread t = new Thread(t1); t.Start(); public Class MyThread extends Thread { public void run() { System.out.println(“In Thread”); } } To Invoke: MyThread t1 = new MyThread(); t1.start(); Implementing the Runnable Interface Extending the Thread Class
  • 53. Threads – Thread Life cycle runnable end blocked start running T1 T2 T1 T2 T1 T2 T1 T1 T2
  • 54.
  • 55. Threads – Synchronization Account Account acct = getAccount (123); MyThread t1 = new MyThread(acct); MyThread t2 = new MyThread(acct); t1.start(); t2.start(); shared object public class Account { private int bal; private int acctId; … public Account(int acctId) { this.acctId = acctId; } public boolean withdraw(int amt) { if (bal > 0) { // give money // other related activities bal = bal – amt; } } } run() run() T1 stack T2 stack acct acct 100 140 50 100 90 100
  • 56. DEMO