SlideShare a Scribd company logo
Welcome To Computer Technology Institute
(CTI)
Programming Fundamentals Using java
Lecture 2
Jawid Ahmad Niazi
1
Prepared By: Jawid Ahmad Niazi
Welcome to Java Programming!
• Comments
– Text surrounded by /* and */ or // is ignored by computer
– Used to describe program
• public class Welcome1
– Every Java program consists of at least one class that you define
– Java is case sensitive—uppercase and lowercase letters are distinct—so value and Value
are different identifiers
public static void main(String[] args)
• – is the starting point of every Java application. The parentheses after
the identifier main indicate that it’s a program building block called a
method. Java class declarations normally contain one or more
methods. For a Java application, one of the methods must be called
main and must be defined– Parenthesis used to indicate a function
Welcome to Java Programming!
The output of the program will be:
31
Symbol
( )
Name
Parentheses
Purpose
Used to contain list of
parameters
Used to maintain the
value of arrays
Used to declare array type
Terminates statements
Used to chain statements
together inside a for
statement
Used to separate package
{ } Braces
[ ]
;
,
Brackets
Semicolon
Comma
. Period
names and variables
• Integers
– This group includes byte, short, int, long which are for whole valued signed
numbers.
• Floating-point numbers
– This group includes float and double, which represent numbers with fractional precision.
• Characters
– This group includes char, which represents symbols in a character set, like letters and
numbers.
• Boolean
– This group includes boolean, which is a special type for
representing true/false values.
• To store value in program we use variable.
• Each variable is categorized by type according to what type of value it
stores. Integer, floating-point, and character are frequently used type.
• Variables must be declared before use.
Variable
value Stored value is allocated somewhere in the computer memory. Novice
programmer usually does not have to be conscious about the location.
Variable is like a vessel that can store a value of a specified type
• Variables that score integer are declared as integer type
• Use int as the declaration of integer type
Public static void main(String[]args){
{
int x;
x = 1;
System.out.println( “x= ”+x);
}
Declare variable x as integer type
Assign integer 1 to variable x
Output the content of variable x
The variable name (identifier) can be arbitray but must start with alphabet.
Keywords of java language cannot be used as variable name.
= is assignment operator that assigns the expression in the right hand to the variable in the left hand
To declare variable, specify the type (int for integer type)
followed by the variable name.
Name Width in Bits
double
float
64
32
• What happens whe the following programs are compiled an executed?
Public class test{
Public static void main(String[]args){
{
x = 1;
System.out.println("x = “+x);
}
}
Public class test1{
Public static void main(String[]args){
{
int x;
System.out.println("x = “+x);
}
}
Variable x is not declared before
assigned a value. Compile error.
Variable declared but not assigned
a value might contain meaningless
value (garbage).
This would display nonsense value.
Public class ahmad{
public static void main(String args[]) {
char ch1, ch2;
ch1=88; // code for X
ch2= ‘Y’;
System.out.print (“ch1 and ch2: ”);
System.out.println(ch1 + “ ” +ch2);
}
}
Public class bool{
public static void main(String args[]) {
boolean b;
b = false;
System.out.println(“b is ” +b);
b=true;
System.out.println(“b is ” +b);
}
}
Output of addition
Any Question……

More Related Content

What's hot (20)

ITFT - Java
ITFT - JavaITFT - Java
ITFT - Java
Blossom Sood
 
3 java - variable type
3  java - variable type3  java - variable type
3 java - variable type
vinay arora
 
Week 2: Getting Your Hands Dirty – Part 2
Week 2: Getting Your Hands Dirty – Part 2Week 2: Getting Your Hands Dirty – Part 2
Week 2: Getting Your Hands Dirty – Part 2
Jamshid Hashimi
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
Debasish Pratihari
 
Classes objects in java
Classes objects in javaClasses objects in java
Classes objects in java
Madishetty Prathibha
 
Delegetes in c#
Delegetes in c#Delegetes in c#
Delegetes in c#
Mahbub Hasan
 
Week 1: Getting Your Hands Dirty - Part 1
Week 1: Getting Your Hands Dirty - Part 1Week 1: Getting Your Hands Dirty - Part 1
Week 1: Getting Your Hands Dirty - Part 1
Jamshid Hashimi
 
Java
JavaJava
Java
mbruggen
 
Variable
VariableVariable
Variable
abdullah al mahamud rosi
 
Datatype
DatatypeDatatype
Datatype
baran19901990
 
C# Delegates
C# DelegatesC# Delegates
C# Delegates
Prem Kumar Badri
 
Java Variable Types
Java Variable TypesJava Variable Types
Java Variable Types
Shahid Rasheed
 
OOP interview questions & answers.
OOP interview questions & answers.OOP interview questions & answers.
OOP interview questions & answers.
Questpond
 
Static keyword ppt
Static keyword pptStatic keyword ppt
Static keyword ppt
Vinod Kumar
 
Delegates in C#
Delegates in C#Delegates in C#
Delegates in C#
SNJ Chaudhary
 
Ch6
Ch6Ch6
Ch6
kinnarshah8888
 
Java platform
Java platformJava platform
Java platform
Visithan
 
Explain Delegates step by step.
Explain Delegates step by step.Explain Delegates step by step.
Explain Delegates step by step.
Questpond
 
Md03 - part3
Md03 - part3Md03 - part3
Md03 - part3
Rakesh Madugula
 
C++ Object oriented concepts & programming
C++ Object oriented concepts & programmingC++ Object oriented concepts & programming
C++ Object oriented concepts & programming
nirajmandaliya
 

Similar to Lecture02 java (20)

7-Java Language Basics Part1
7-Java Language Basics Part17-Java Language Basics Part1
7-Java Language Basics Part1
Amr Elghadban (AmrAngry)
 
Object oriented programming1 Week 1.pptx
Object oriented programming1 Week 1.pptxObject oriented programming1 Week 1.pptx
Object oriented programming1 Week 1.pptx
MirHazarKhan1
 
Lec-2- Ehsjdjkck. Jdkdbd djskrogramming.pdf
Lec-2- Ehsjdjkck. Jdkdbd djskrogramming.pdfLec-2- Ehsjdjkck. Jdkdbd djskrogramming.pdf
Lec-2- Ehsjdjkck. Jdkdbd djskrogramming.pdf
RahulKumar342376
 
savitchAbsJavaPPT Java Programming Part 1
savitchAbsJavaPPT Java Programming Part 1savitchAbsJavaPPT Java Programming Part 1
savitchAbsJavaPPT Java Programming Part 1
Ghazanfar Latif (Gabe)
 
Control structure repetition Tito Lacbayen
Control structure repetition Tito LacbayenControl structure repetition Tito Lacbayen
Control structure repetition Tito Lacbayen
LacbayenEchaviaTitoJ
 
Data types, Variables, Expressions & Arithmetic Operators in java
Data types, Variables, Expressions & Arithmetic Operators in javaData types, Variables, Expressions & Arithmetic Operators in java
Data types, Variables, Expressions & Arithmetic Operators in java
Javed Rashid
 
Programming in Java: Storing Data
Programming in Java: Storing DataProgramming in Java: Storing Data
Programming in Java: Storing Data
Martin Chapman
 
Hello java
Hello java  Hello java
Hello java
University of Babylon
 
Hello java
Hello java   Hello java
Hello java
University of Babylon
 
Hello Java-First Level
Hello Java-First LevelHello Java-First Level
Hello Java-First Level
Dr. Raaid Alubady
 
Java fundamentals
Java fundamentalsJava fundamentals
Java fundamentals
Jayfee Ramos
 
Pi j1.2 variable-assignment
Pi j1.2 variable-assignmentPi j1.2 variable-assignment
Pi j1.2 variable-assignment
mcollison
 
Lesson 4 - Data and Variables.pdf
Lesson 4 - Data and Variables.pdfLesson 4 - Data and Variables.pdf
Lesson 4 - Data and Variables.pdf
ROWELL MARQUINA
 
Introduction to computer science
Introduction to computer scienceIntroduction to computer science
Introduction to computer science
umardanjumamaiwada
 
lecture 6
 lecture 6 lecture 6
lecture 6
umardanjumamaiwada
 
Java Basic day-1
Java Basic day-1Java Basic day-1
Java Basic day-1
Kamlesh Singh
 
Unit 1: Primitive Types - Variables and Datatypes
Unit 1: Primitive Types - Variables and DatatypesUnit 1: Primitive Types - Variables and Datatypes
Unit 1: Primitive Types - Variables and Datatypes
agautham211
 
Java Programming For Android
Java Programming For AndroidJava Programming For Android
Java Programming For Android
TechiNerd
 
CSC111-Chap_02.pdf
CSC111-Chap_02.pdfCSC111-Chap_02.pdf
CSC111-Chap_02.pdf
2b75fd3051
 
Java Basics.pdf
Java Basics.pdfJava Basics.pdf
Java Basics.pdf
EdFeranil
 
Object oriented programming1 Week 1.pptx
Object oriented programming1 Week 1.pptxObject oriented programming1 Week 1.pptx
Object oriented programming1 Week 1.pptx
MirHazarKhan1
 
Lec-2- Ehsjdjkck. Jdkdbd djskrogramming.pdf
Lec-2- Ehsjdjkck. Jdkdbd djskrogramming.pdfLec-2- Ehsjdjkck. Jdkdbd djskrogramming.pdf
Lec-2- Ehsjdjkck. Jdkdbd djskrogramming.pdf
RahulKumar342376
 
savitchAbsJavaPPT Java Programming Part 1
savitchAbsJavaPPT Java Programming Part 1savitchAbsJavaPPT Java Programming Part 1
savitchAbsJavaPPT Java Programming Part 1
Ghazanfar Latif (Gabe)
 
Control structure repetition Tito Lacbayen
Control structure repetition Tito LacbayenControl structure repetition Tito Lacbayen
Control structure repetition Tito Lacbayen
LacbayenEchaviaTitoJ
 
Data types, Variables, Expressions & Arithmetic Operators in java
Data types, Variables, Expressions & Arithmetic Operators in javaData types, Variables, Expressions & Arithmetic Operators in java
Data types, Variables, Expressions & Arithmetic Operators in java
Javed Rashid
 
Programming in Java: Storing Data
Programming in Java: Storing DataProgramming in Java: Storing Data
Programming in Java: Storing Data
Martin Chapman
 
Pi j1.2 variable-assignment
Pi j1.2 variable-assignmentPi j1.2 variable-assignment
Pi j1.2 variable-assignment
mcollison
 
Lesson 4 - Data and Variables.pdf
Lesson 4 - Data and Variables.pdfLesson 4 - Data and Variables.pdf
Lesson 4 - Data and Variables.pdf
ROWELL MARQUINA
 
Introduction to computer science
Introduction to computer scienceIntroduction to computer science
Introduction to computer science
umardanjumamaiwada
 
Unit 1: Primitive Types - Variables and Datatypes
Unit 1: Primitive Types - Variables and DatatypesUnit 1: Primitive Types - Variables and Datatypes
Unit 1: Primitive Types - Variables and Datatypes
agautham211
 
Java Programming For Android
Java Programming For AndroidJava Programming For Android
Java Programming For Android
TechiNerd
 
CSC111-Chap_02.pdf
CSC111-Chap_02.pdfCSC111-Chap_02.pdf
CSC111-Chap_02.pdf
2b75fd3051
 
Java Basics.pdf
Java Basics.pdfJava Basics.pdf
Java Basics.pdf
EdFeranil
 

Recently uploaded (20)

Patent Law in Bangladesh Addressing Challenges in Pharmaceutical Innovation a...
Patent Law in Bangladesh Addressing Challenges in Pharmaceutical Innovation a...Patent Law in Bangladesh Addressing Challenges in Pharmaceutical Innovation a...
Patent Law in Bangladesh Addressing Challenges in Pharmaceutical Innovation a...
Ibrahim Tareq
 
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdfTechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup
 
Quiz-E-Mataram (Under 20 Quiz Set) .pptx
Quiz-E-Mataram (Under 20 Quiz Set) .pptxQuiz-E-Mataram (Under 20 Quiz Set) .pptx
Quiz-E-Mataram (Under 20 Quiz Set) .pptx
SouptikUkil
 
Philosophical Basis of Curriculum Designing
Philosophical Basis of Curriculum DesigningPhilosophical Basis of Curriculum Designing
Philosophical Basis of Curriculum Designing
Ankit Choudhary
 
Low Vison introduction from Aligarh Muslim University
Low Vison introduction from Aligarh Muslim UniversityLow Vison introduction from Aligarh Muslim University
Low Vison introduction from Aligarh Muslim University
Aligarh Muslim University, Aligarh, Uttar Pradesh, India
 
"Dictyoptera: The Order of Cockroaches and Mantises" Or, more specifically: ...
"Dictyoptera: The Order of Cockroaches and Mantises"  Or, more specifically: ..."Dictyoptera: The Order of Cockroaches and Mantises"  Or, more specifically: ...
"Dictyoptera: The Order of Cockroaches and Mantises" Or, more specifically: ...
Arshad Shaikh
 
Sri Guru Arjun Dev Ji .
Sri Guru Arjun Dev Ji                   .Sri Guru Arjun Dev Ji                   .
Sri Guru Arjun Dev Ji .
Balvir Singh
 
Decision Tree-ID3,C4.5,CART,Regression Tree
Decision Tree-ID3,C4.5,CART,Regression TreeDecision Tree-ID3,C4.5,CART,Regression Tree
Decision Tree-ID3,C4.5,CART,Regression Tree
Global Academy of Technology
 
0b - THE ROMANTIC ERA: FEELINGS AND IDENTITY.pptx
0b - THE ROMANTIC ERA: FEELINGS AND IDENTITY.pptx0b - THE ROMANTIC ERA: FEELINGS AND IDENTITY.pptx
0b - THE ROMANTIC ERA: FEELINGS AND IDENTITY.pptx
Julián Jesús Pérez Fernández
 
Multicultural approach in education - B.Ed
Multicultural approach in education - B.EdMulticultural approach in education - B.Ed
Multicultural approach in education - B.Ed
prathimagowda443
 
Optical and non optical devices used in low vision
Optical and non optical devices used in low visionOptical and non optical devices used in low vision
Optical and non optical devices used in low vision
Aligarh Muslim University, Aligarh, Uttar Pradesh, India
 
5503 Course Proposal Online Computer Middle School Course Wood M.pdf
5503 Course Proposal Online Computer Middle School Course Wood M.pdf5503 Course Proposal Online Computer Middle School Course Wood M.pdf
5503 Course Proposal Online Computer Middle School Course Wood M.pdf
Melanie Wood
 
What are the Features & Functions of Odoo 18 SMS Marketing
What are the Features & Functions of Odoo 18 SMS MarketingWhat are the Features & Functions of Odoo 18 SMS Marketing
What are the Features & Functions of Odoo 18 SMS Marketing
Celine George
 
Unit 1 Kali NetHunter is the official Kali Linux penetration testing platform...
Unit 1 Kali NetHunter is the official Kali Linux penetration testing platform...Unit 1 Kali NetHunter is the official Kali Linux penetration testing platform...
Unit 1 Kali NetHunter is the official Kali Linux penetration testing platform...
ChatanBawankar
 
the dynastic history of the Gahadwals of Early Medieval Period
the dynastic history of the Gahadwals of Early Medieval Periodthe dynastic history of the Gahadwals of Early Medieval Period
the dynastic history of the Gahadwals of Early Medieval Period
PrachiSontakke5
 
Unit 1 Tools Beneficial for Monitoring the Debugging Process.pdf
Unit 1 Tools Beneficial for Monitoring the Debugging Process.pdfUnit 1 Tools Beneficial for Monitoring the Debugging Process.pdf
Unit 1 Tools Beneficial for Monitoring the Debugging Process.pdf
ChatanBawankar
 
Order Lepidoptera: Butterflies and Moths.pptx
Order Lepidoptera: Butterflies and Moths.pptxOrder Lepidoptera: Butterflies and Moths.pptx
Order Lepidoptera: Butterflies and Moths.pptx
Arshad Shaikh
 
Unit Kali NetHunter is the official Kali Linux penetration testing platform f...
Unit Kali NetHunter is the official Kali Linux penetration testing platform f...Unit Kali NetHunter is the official Kali Linux penetration testing platform f...
Unit Kali NetHunter is the official Kali Linux penetration testing platform f...
ChatanBawankar
 
Policies, procedures, subject selection and QTAC.pptx
Policies, procedures, subject selection and QTAC.pptxPolicies, procedures, subject selection and QTAC.pptx
Policies, procedures, subject selection and QTAC.pptx
mansk2
 
Unit 2 DNS Spoofing in a BadUSB Attack.pdf
Unit 2 DNS Spoofing in a BadUSB Attack.pdfUnit 2 DNS Spoofing in a BadUSB Attack.pdf
Unit 2 DNS Spoofing in a BadUSB Attack.pdf
ChatanBawankar
 
Patent Law in Bangladesh Addressing Challenges in Pharmaceutical Innovation a...
Patent Law in Bangladesh Addressing Challenges in Pharmaceutical Innovation a...Patent Law in Bangladesh Addressing Challenges in Pharmaceutical Innovation a...
Patent Law in Bangladesh Addressing Challenges in Pharmaceutical Innovation a...
Ibrahim Tareq
 
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdfTechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup
 
Quiz-E-Mataram (Under 20 Quiz Set) .pptx
Quiz-E-Mataram (Under 20 Quiz Set) .pptxQuiz-E-Mataram (Under 20 Quiz Set) .pptx
Quiz-E-Mataram (Under 20 Quiz Set) .pptx
SouptikUkil
 
Philosophical Basis of Curriculum Designing
Philosophical Basis of Curriculum DesigningPhilosophical Basis of Curriculum Designing
Philosophical Basis of Curriculum Designing
Ankit Choudhary
 
"Dictyoptera: The Order of Cockroaches and Mantises" Or, more specifically: ...
"Dictyoptera: The Order of Cockroaches and Mantises"  Or, more specifically: ..."Dictyoptera: The Order of Cockroaches and Mantises"  Or, more specifically: ...
"Dictyoptera: The Order of Cockroaches and Mantises" Or, more specifically: ...
Arshad Shaikh
 
Sri Guru Arjun Dev Ji .
Sri Guru Arjun Dev Ji                   .Sri Guru Arjun Dev Ji                   .
Sri Guru Arjun Dev Ji .
Balvir Singh
 
Multicultural approach in education - B.Ed
Multicultural approach in education - B.EdMulticultural approach in education - B.Ed
Multicultural approach in education - B.Ed
prathimagowda443
 
5503 Course Proposal Online Computer Middle School Course Wood M.pdf
5503 Course Proposal Online Computer Middle School Course Wood M.pdf5503 Course Proposal Online Computer Middle School Course Wood M.pdf
5503 Course Proposal Online Computer Middle School Course Wood M.pdf
Melanie Wood
 
What are the Features & Functions of Odoo 18 SMS Marketing
What are the Features & Functions of Odoo 18 SMS MarketingWhat are the Features & Functions of Odoo 18 SMS Marketing
What are the Features & Functions of Odoo 18 SMS Marketing
Celine George
 
Unit 1 Kali NetHunter is the official Kali Linux penetration testing platform...
Unit 1 Kali NetHunter is the official Kali Linux penetration testing platform...Unit 1 Kali NetHunter is the official Kali Linux penetration testing platform...
Unit 1 Kali NetHunter is the official Kali Linux penetration testing platform...
ChatanBawankar
 
the dynastic history of the Gahadwals of Early Medieval Period
the dynastic history of the Gahadwals of Early Medieval Periodthe dynastic history of the Gahadwals of Early Medieval Period
the dynastic history of the Gahadwals of Early Medieval Period
PrachiSontakke5
 
Unit 1 Tools Beneficial for Monitoring the Debugging Process.pdf
Unit 1 Tools Beneficial for Monitoring the Debugging Process.pdfUnit 1 Tools Beneficial for Monitoring the Debugging Process.pdf
Unit 1 Tools Beneficial for Monitoring the Debugging Process.pdf
ChatanBawankar
 
Order Lepidoptera: Butterflies and Moths.pptx
Order Lepidoptera: Butterflies and Moths.pptxOrder Lepidoptera: Butterflies and Moths.pptx
Order Lepidoptera: Butterflies and Moths.pptx
Arshad Shaikh
 
Unit Kali NetHunter is the official Kali Linux penetration testing platform f...
Unit Kali NetHunter is the official Kali Linux penetration testing platform f...Unit Kali NetHunter is the official Kali Linux penetration testing platform f...
Unit Kali NetHunter is the official Kali Linux penetration testing platform f...
ChatanBawankar
 
Policies, procedures, subject selection and QTAC.pptx
Policies, procedures, subject selection and QTAC.pptxPolicies, procedures, subject selection and QTAC.pptx
Policies, procedures, subject selection and QTAC.pptx
mansk2
 
Unit 2 DNS Spoofing in a BadUSB Attack.pdf
Unit 2 DNS Spoofing in a BadUSB Attack.pdfUnit 2 DNS Spoofing in a BadUSB Attack.pdf
Unit 2 DNS Spoofing in a BadUSB Attack.pdf
ChatanBawankar
 

Lecture02 java

  • 1. Welcome To Computer Technology Institute (CTI) Programming Fundamentals Using java Lecture 2 Jawid Ahmad Niazi 1 Prepared By: Jawid Ahmad Niazi
  • 2. Welcome to Java Programming! • Comments – Text surrounded by /* and */ or // is ignored by computer – Used to describe program • public class Welcome1 – Every Java program consists of at least one class that you define – Java is case sensitive—uppercase and lowercase letters are distinct—so value and Value are different identifiers
  • 3. public static void main(String[] args) • – is the starting point of every Java application. The parentheses after the identifier main indicate that it’s a program building block called a method. Java class declarations normally contain one or more methods. For a Java application, one of the methods must be called main and must be defined– Parenthesis used to indicate a function
  • 4. Welcome to Java Programming! The output of the program will be:
  • 5. 31 Symbol ( ) Name Parentheses Purpose Used to contain list of parameters Used to maintain the value of arrays Used to declare array type Terminates statements Used to chain statements together inside a for statement Used to separate package { } Braces [ ] ; , Brackets Semicolon Comma . Period names and variables
  • 6. • Integers – This group includes byte, short, int, long which are for whole valued signed numbers. • Floating-point numbers – This group includes float and double, which represent numbers with fractional precision. • Characters – This group includes char, which represents symbols in a character set, like letters and numbers. • Boolean – This group includes boolean, which is a special type for representing true/false values.
  • 7. • To store value in program we use variable. • Each variable is categorized by type according to what type of value it stores. Integer, floating-point, and character are frequently used type. • Variables must be declared before use. Variable value Stored value is allocated somewhere in the computer memory. Novice programmer usually does not have to be conscious about the location. Variable is like a vessel that can store a value of a specified type
  • 8. • Variables that score integer are declared as integer type • Use int as the declaration of integer type Public static void main(String[]args){ { int x; x = 1; System.out.println( “x= ”+x); } Declare variable x as integer type Assign integer 1 to variable x Output the content of variable x The variable name (identifier) can be arbitray but must start with alphabet. Keywords of java language cannot be used as variable name. = is assignment operator that assigns the expression in the right hand to the variable in the left hand To declare variable, specify the type (int for integer type) followed by the variable name.
  • 9. Name Width in Bits double float 64 32
  • 10. • What happens whe the following programs are compiled an executed? Public class test{ Public static void main(String[]args){ { x = 1; System.out.println("x = “+x); } } Public class test1{ Public static void main(String[]args){ { int x; System.out.println("x = “+x); } } Variable x is not declared before assigned a value. Compile error. Variable declared but not assigned a value might contain meaningless value (garbage). This would display nonsense value.
  • 11. Public class ahmad{ public static void main(String args[]) { char ch1, ch2; ch1=88; // code for X ch2= ‘Y’; System.out.print (“ch1 and ch2: ”); System.out.println(ch1 + “ ” +ch2); } }
  • 12. Public class bool{ public static void main(String args[]) { boolean b; b = false; System.out.println(“b is ” +b); b=true; System.out.println(“b is ” +b); } }