SlideShare a Scribd company logo
1 of 1
Download to read offline
Task 4: The scope of variables What is the output of the following program? public class Test {
private static int i=2; private static int j=4; public static void main(String[] args) { int i=9; int k=3; { int
j=3; System.out.println(" i is " +i+ " and j is " +j ); } k=i+j; System.out.println("k is " +k);
System.out.println(" j is " +j); } }

More Related Content

More from accostinternational

C Jones is a 63yearold female with a fiveyear history of.pdf
C Jones is a 63yearold female with a fiveyear history of.pdfC Jones is a 63yearold female with a fiveyear history of.pdf
C Jones is a 63yearold female with a fiveyear history of.pdf
accostinternational
 
The following assumptions and exhibits will be used in prepa.pdf
The following assumptions and exhibits will be used in prepa.pdfThe following assumptions and exhibits will be used in prepa.pdf
The following assumptions and exhibits will be used in prepa.pdf
accostinternational
 
React mui question I am passing a data into a Item Every.pdf
React mui question I am passing a data into a Item Every.pdfReact mui question I am passing a data into a Item Every.pdf
React mui question I am passing a data into a Item Every.pdf
accostinternational
 
public class MyLinkedListltE extends ComparableltEgtg.pdf
public class MyLinkedListltE extends ComparableltEgtg.pdfpublic class MyLinkedListltE extends ComparableltEgtg.pdf
public class MyLinkedListltE extends ComparableltEgtg.pdf
accostinternational
 
please and thank you Adapted from Kristen St John James.pdf
please and thank you  Adapted from Kristen St John James.pdfplease and thank you  Adapted from Kristen St John James.pdf
please and thank you Adapted from Kristen St John James.pdf
accostinternational
 
K Direktr olarak David bir eitlilik ynetimi program pla.pdf
K Direktr olarak David bir eitlilik ynetimi program pla.pdfK Direktr olarak David bir eitlilik ynetimi program pla.pdf
K Direktr olarak David bir eitlilik ynetimi program pla.pdf
accostinternational
 
Case Scenario JJ is a greeneyed blondhaired freckleface.pdf
Case Scenario JJ is a greeneyed blondhaired freckleface.pdfCase Scenario JJ is a greeneyed blondhaired freckleface.pdf
Case Scenario JJ is a greeneyed blondhaired freckleface.pdf
accostinternational
 
Below are balance sheets for Starbucks Corporation the reta.pdf
Below are balance sheets for Starbucks Corporation the reta.pdfBelow are balance sheets for Starbucks Corporation the reta.pdf
Below are balance sheets for Starbucks Corporation the reta.pdf
accostinternational
 
Required Complete the Hosers federal tax return for 2022.pdf
 Required Complete the Hosers federal tax return for 2022.pdf Required Complete the Hosers federal tax return for 2022.pdf
Required Complete the Hosers federal tax return for 2022.pdf
accostinternational
 

More from accostinternational (20)

C Jones is a 63yearold female with a fiveyear history of.pdf
C Jones is a 63yearold female with a fiveyear history of.pdfC Jones is a 63yearold female with a fiveyear history of.pdf
C Jones is a 63yearold female with a fiveyear history of.pdf
 
We know the following expected returns for stocks A and B g.pdf
We know the following expected returns for stocks A and B g.pdfWe know the following expected returns for stocks A and B g.pdf
We know the following expected returns for stocks A and B g.pdf
 
The following assumptions and exhibits will be used in prepa.pdf
The following assumptions and exhibits will be used in prepa.pdfThe following assumptions and exhibits will be used in prepa.pdf
The following assumptions and exhibits will be used in prepa.pdf
 
A Describir cmo se transporta la informacin gentica en l.pdf
A Describir cmo se transporta la informacin gentica en l.pdfA Describir cmo se transporta la informacin gentica en l.pdf
A Describir cmo se transporta la informacin gentica en l.pdf
 
EXHIBIT 515 Payroll System FlowchartFollowing is a selec.pdf
EXHIBIT 515 Payroll System FlowchartFollowing is a selec.pdfEXHIBIT 515 Payroll System FlowchartFollowing is a selec.pdf
EXHIBIT 515 Payroll System FlowchartFollowing is a selec.pdf
 
Regarding the ENS The descending interneurons release 1 t.pdf
Regarding the ENS The descending interneurons release 1 t.pdfRegarding the ENS The descending interneurons release 1 t.pdf
Regarding the ENS The descending interneurons release 1 t.pdf
 
React mui question I am passing a data into a Item Every.pdf
React mui question I am passing a data into a Item Every.pdfReact mui question I am passing a data into a Item Every.pdf
React mui question I am passing a data into a Item Every.pdf
 
public class MyLinkedListltE extends ComparableltEgtg.pdf
public class MyLinkedListltE extends ComparableltEgtg.pdfpublic class MyLinkedListltE extends ComparableltEgtg.pdf
public class MyLinkedListltE extends ComparableltEgtg.pdf
 
please and thank you Adapted from Kristen St John James.pdf
please and thank you  Adapted from Kristen St John James.pdfplease and thank you  Adapted from Kristen St John James.pdf
please and thank you Adapted from Kristen St John James.pdf
 
Joe and Jessie are married and have one dependent child Liz.pdf
Joe and Jessie are married and have one dependent child Liz.pdfJoe and Jessie are married and have one dependent child Liz.pdf
Joe and Jessie are married and have one dependent child Liz.pdf
 
K Direktr olarak David bir eitlilik ynetimi program pla.pdf
K Direktr olarak David bir eitlilik ynetimi program pla.pdfK Direktr olarak David bir eitlilik ynetimi program pla.pdf
K Direktr olarak David bir eitlilik ynetimi program pla.pdf
 
khikdhficdadfbfcabcg Change all expression into c.pdf
khikdhficdadfbfcabcg  Change all expression into c.pdfkhikdhficdadfbfcabcg  Change all expression into c.pdf
khikdhficdadfbfcabcg Change all expression into c.pdf
 
Develop a reverse logistics system planning for recycling el.pdf
Develop a reverse logistics system planning for recycling el.pdfDevelop a reverse logistics system planning for recycling el.pdf
Develop a reverse logistics system planning for recycling el.pdf
 
in C++ Write a program that asks a user for two points that .pdf
in C++ Write a program that asks a user for two points that .pdfin C++ Write a program that asks a user for two points that .pdf
in C++ Write a program that asks a user for two points that .pdf
 
During 2019 its first year of operations and 2020 Fieri F.pdf
During 2019 its first year of operations and 2020 Fieri F.pdfDuring 2019 its first year of operations and 2020 Fieri F.pdf
During 2019 its first year of operations and 2020 Fieri F.pdf
 
In a survoy people were asked whether they thought sun went.pdf
In a survoy people were asked whether they thought sun went.pdfIn a survoy people were asked whether they thought sun went.pdf
In a survoy people were asked whether they thought sun went.pdf
 
Case Scenario JJ is a greeneyed blondhaired freckleface.pdf
Case Scenario JJ is a greeneyed blondhaired freckleface.pdfCase Scenario JJ is a greeneyed blondhaired freckleface.pdf
Case Scenario JJ is a greeneyed blondhaired freckleface.pdf
 
Find the indicated 1I score The graph to the right depicts .pdf
Find the indicated 1I score The graph to the right depicts .pdfFind the indicated 1I score The graph to the right depicts .pdf
Find the indicated 1I score The graph to the right depicts .pdf
 
Below are balance sheets for Starbucks Corporation the reta.pdf
Below are balance sheets for Starbucks Corporation the reta.pdfBelow are balance sheets for Starbucks Corporation the reta.pdf
Below are balance sheets for Starbucks Corporation the reta.pdf
 
Required Complete the Hosers federal tax return for 2022.pdf
 Required Complete the Hosers federal tax return for 2022.pdf Required Complete the Hosers federal tax return for 2022.pdf
Required Complete the Hosers federal tax return for 2022.pdf
 

Recently uploaded

Recently uploaded (20)

VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 

Task 4 The scope of variables What is the output of the fol.pdf

  • 1. Task 4: The scope of variables What is the output of the following program? public class Test { private static int i=2; private static int j=4; public static void main(String[] args) { int i=9; int k=3; { int j=3; System.out.println(" i is " +i+ " and j is " +j ); } k=i+j; System.out.println("k is " +k); System.out.println(" j is " +j); } }