SlideShare a Scribd company logo
1 of 5
Oct 13th 
Lab09. 
Stack, Heap, and Metaspace 
http://www.slideshare.net/takyeon
public class Student { 
public String name; 
public int tokenLevel; 
private static int currentCount = 0; 
private static final int DEFAULT_TOKENS = 3; 
public Student() { 
name = "unknown"; 
tokenLevel = DEFAULT_TOKENS; 
currentCount++; 
} 
} 
Student s1 = new Student(); 
s1.name = "Tak"; 
currentCount 1 X 
DEFAULT_TOKENS 
constructor 
"unknown" 
STACK HEAP META SPACE 
0 
3 
s1 
name 
tokenLevel 3 
"Tak" 
All static fields of a class live in 
Metaspace. 
All local variables (both 
primitives and references) 
live on the stack. Non-primitive 
data objects are 
stored in the heap, and 
referenced by variables on 
the stack. 
All non-primitive objects live on the heap. 
Primitive instance variables of those objects 
are stored inside the object. Non-primitive 
variables are stored outside of the object, 
and referenced by the instance variable.
Size? 5 
* 
*** 
***** 
******* 
********* 
Scanner sc = new Scanner(System.in); 
int size = sc.nextInt(); 
for(int row=0; row<size; row++) { 
for(int col=0;col<4-row;col++) { 
System.out.print(" "); 
} 
for(int col=0;col<row*2+1;col++) { 
System.out.print("*"); 
} 
System.out.println(); 
} 
sc.close(); 
row col : 1st 
spaces before * 
col : 2nd 
number of * 
0 4 1 
1 3 3 
2 2 5 
3 1 7 
4 0 9
int x,y; 
x=2; y=5; 
System.out.println(x++ * y++); 
System.out.println(++x * ++y); 
System.out.println(++x * y++); 
System.out.println(x++ * ++y); 
System.out.println("1 + 2 = " + 1 + 2); 
System.out.println("1 + 2 = " + (1 + 2)); 
1 + 2 = 12 
1 + 2 = 3 
year % 4 == 0 && year % 100 != 0 || year % 400 == 0 
((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)
Any question?

More Related Content

What's hot

Java 8 - project lambda
Java 8 - project lambdaJava 8 - project lambda
Java 8 - project lambdaIvar Østhus
 
Ds006 linked list- delete from front
Ds006   linked list- delete from frontDs006   linked list- delete from front
Ds006 linked list- delete from frontjyoti_lakhani
 
Link list part 2
Link list part 2Link list part 2
Link list part 2Anaya Zafar
 
.NET Fest 2018. Дмитрий Иванов. Иммутабельные структуры данных в .NET: зачем ...
.NET Fest 2018. Дмитрий Иванов. Иммутабельные структуры данных в .NET: зачем ....NET Fest 2018. Дмитрий Иванов. Иммутабельные структуры данных в .NET: зачем ...
.NET Fest 2018. Дмитрий Иванов. Иммутабельные структуры данных в .NET: зачем ...NETFest
 
Operator overloading (binary)
Operator overloading (binary)Operator overloading (binary)
Operator overloading (binary)Ramish Suleman
 
Introduction to MySQL in PHP
Introduction to MySQL in PHPIntroduction to MySQL in PHP
Introduction to MySQL in PHPhamsa nandhini
 
Database design and error handling
Database design and error handlingDatabase design and error handling
Database design and error handlinghamsa nandhini
 
Scala - fra newbie til ninja på en time
Scala - fra newbie til ninja på en timeScala - fra newbie til ninja på en time
Scala - fra newbie til ninja på en timekarianneberg
 
Functional Algebra: Monoids Applied
Functional Algebra: Monoids AppliedFunctional Algebra: Monoids Applied
Functional Algebra: Monoids AppliedSusan Potter
 
Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»
Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»
Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»Anna Shymchenko
 
Java Foundations: Lists, ArrayList<T>
Java Foundations: Lists, ArrayList<T>Java Foundations: Lists, ArrayList<T>
Java Foundations: Lists, ArrayList<T>Svetlin Nakov
 
Tcl2012 8.6 Changes
Tcl2012 8.6 ChangesTcl2012 8.6 Changes
Tcl2012 8.6 Changeshobbs
 
Psycopg2 postgres python DDL Operaytions (select , Insert , update, create ta...
Psycopg2 postgres python DDL Operaytions (select , Insert , update, create ta...Psycopg2 postgres python DDL Operaytions (select , Insert , update, create ta...
Psycopg2 postgres python DDL Operaytions (select , Insert , update, create ta...sachin kumar
 
Contact Book Version 1.0
Contact Book Version 1.0Contact Book Version 1.0
Contact Book Version 1.0Salman Mushtaq
 

What's hot (20)

Java 8 - project lambda
Java 8 - project lambdaJava 8 - project lambda
Java 8 - project lambda
 
Ds006 linked list- delete from front
Ds006   linked list- delete from frontDs006   linked list- delete from front
Ds006 linked list- delete from front
 
Link list part 2
Link list part 2Link list part 2
Link list part 2
 
Stack queue
Stack queueStack queue
Stack queue
 
.NET Fest 2018. Дмитрий Иванов. Иммутабельные структуры данных в .NET: зачем ...
.NET Fest 2018. Дмитрий Иванов. Иммутабельные структуры данных в .NET: зачем ....NET Fest 2018. Дмитрий Иванов. Иммутабельные структуры данных в .NET: зачем ...
.NET Fest 2018. Дмитрий Иванов. Иммутабельные структуры данных в .NET: зачем ...
 
Operator overloading (binary)
Operator overloading (binary)Operator overloading (binary)
Operator overloading (binary)
 
Introduction to MySQL in PHP
Introduction to MySQL in PHPIntroduction to MySQL in PHP
Introduction to MySQL in PHP
 
Database design and error handling
Database design and error handlingDatabase design and error handling
Database design and error handling
 
Scala - fra newbie til ninja på en time
Scala - fra newbie til ninja på en timeScala - fra newbie til ninja på en time
Scala - fra newbie til ninja på en time
 
Functional Algebra: Monoids Applied
Functional Algebra: Monoids AppliedFunctional Algebra: Monoids Applied
Functional Algebra: Monoids Applied
 
Csharp_Chap13
Csharp_Chap13Csharp_Chap13
Csharp_Chap13
 
Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»
Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»
Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»
 
Java Programming - 06 java file io
Java Programming - 06 java file ioJava Programming - 06 java file io
Java Programming - 06 java file io
 
Cursors in MySQL
Cursors in MySQL Cursors in MySQL
Cursors in MySQL
 
Java Foundations: Lists, ArrayList<T>
Java Foundations: Lists, ArrayList<T>Java Foundations: Lists, ArrayList<T>
Java Foundations: Lists, ArrayList<T>
 
Basics of PHP
Basics of PHPBasics of PHP
Basics of PHP
 
Tcl2012 8.6 Changes
Tcl2012 8.6 ChangesTcl2012 8.6 Changes
Tcl2012 8.6 Changes
 
Psycopg2 postgres python DDL Operaytions (select , Insert , update, create ta...
Psycopg2 postgres python DDL Operaytions (select , Insert , update, create ta...Psycopg2 postgres python DDL Operaytions (select , Insert , update, create ta...
Psycopg2 postgres python DDL Operaytions (select , Insert , update, create ta...
 
Contact Book Version 1.0
Contact Book Version 1.0Contact Book Version 1.0
Contact Book Version 1.0
 
Why Haskell
Why HaskellWhy Haskell
Why Haskell
 

Viewers also liked

Oct8 - 131 slid
Oct8 - 131 slidOct8 - 131 slid
Oct8 - 131 slidTak Lee
 
I S 201 Team Project Disruptive Technology.Docx
I S 201  Team  Project    Disruptive  Technology.DocxI S 201  Team  Project    Disruptive  Technology.Docx
I S 201 Team Project Disruptive Technology.Docxkblack8686
 
Spank Swimming A web comparison
Spank Swimming A web comparisonSpank Swimming A web comparison
Spank Swimming A web comparison13pommersheima
 
Simulado 9-lp-9c2ba-ano
Simulado 9-lp-9c2ba-anoSimulado 9-lp-9c2ba-ano
Simulado 9-lp-9c2ba-anoSergio Vieira
 
Gauntlet Final
Gauntlet FinalGauntlet Final
Gauntlet Finalkblack8686
 
Lab slides - hardware and software
Lab slides - hardware and softwareLab slides - hardware and software
Lab slides - hardware and softwareTak Lee
 
I S 201 Group Project
I S 201  Group  ProjectI S 201  Group  Project
I S 201 Group Projectkblack8686
 
Umd신입생환영회 어디갈까
Umd신입생환영회 어디갈까Umd신입생환영회 어디갈까
Umd신입생환영회 어디갈까Tak Lee
 
Worldviewofchildren
WorldviewofchildrenWorldviewofchildren
Worldviewofchildrenjlrausch
 
Worldviewofchildren
WorldviewofchildrenWorldviewofchildren
Worldviewofchildrenjlrausch
 
Apicultura si produse apicole
Apicultura si produse apicoleApicultura si produse apicole
Apicultura si produse apicoleDaniel Balaj
 
Interface project dejavu_3
Interface project dejavu_3Interface project dejavu_3
Interface project dejavu_3Tak Lee
 
Pension Tax
Pension TaxPension Tax
Pension TaxMandik22
 
Ingrasaminte organice
Ingrasaminte organiceIngrasaminte organice
Ingrasaminte organiceDaniel Balaj
 

Viewers also liked (17)

Oct8 - 131 slid
Oct8 - 131 slidOct8 - 131 slid
Oct8 - 131 slid
 
1 angulo trigonometrico
1 angulo trigonometrico1 angulo trigonometrico
1 angulo trigonometrico
 
I S 201 Team Project Disruptive Technology.Docx
I S 201  Team  Project    Disruptive  Technology.DocxI S 201  Team  Project    Disruptive  Technology.Docx
I S 201 Team Project Disruptive Technology.Docx
 
Spank Swimming A web comparison
Spank Swimming A web comparisonSpank Swimming A web comparison
Spank Swimming A web comparison
 
Simulado 9-lp-9c2ba-ano
Simulado 9-lp-9c2ba-anoSimulado 9-lp-9c2ba-ano
Simulado 9-lp-9c2ba-ano
 
Gauntlet Final
Gauntlet FinalGauntlet Final
Gauntlet Final
 
Lab slides - hardware and software
Lab slides - hardware and softwareLab slides - hardware and software
Lab slides - hardware and software
 
I S 201 Group Project
I S 201  Group  ProjectI S 201  Group  Project
I S 201 Group Project
 
Umd신입생환영회 어디갈까
Umd신입생환영회 어디갈까Umd신입생환영회 어디갈까
Umd신입생환영회 어디갈까
 
Worldviewofchildren
WorldviewofchildrenWorldviewofchildren
Worldviewofchildren
 
Worldviewofchildren
WorldviewofchildrenWorldviewofchildren
Worldviewofchildren
 
Definiciones
Definiciones Definiciones
Definiciones
 
Apicultura si produse apicole
Apicultura si produse apicoleApicultura si produse apicole
Apicultura si produse apicole
 
Interface project dejavu_3
Interface project dejavu_3Interface project dejavu_3
Interface project dejavu_3
 
Pension Tax
Pension TaxPension Tax
Pension Tax
 
Blueberry
BlueberryBlueberry
Blueberry
 
Ingrasaminte organice
Ingrasaminte organiceIngrasaminte organice
Ingrasaminte organice
 

Similar to Oct13' ----

StackInterface An interface for the ADT stack. Do not modif.pdf
StackInterface An interface for the ADT stack. Do not modif.pdfStackInterface An interface for the ADT stack. Do not modif.pdf
StackInterface An interface for the ADT stack. Do not modif.pdfARCHANASTOREKOTA
 
(674335607) cs2309 java-lab-manual
(674335607) cs2309 java-lab-manual(674335607) cs2309 java-lab-manual
(674335607) cs2309 java-lab-manualChandrapriya Jayabal
 
KOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
KOLEJ KOMUNITI - Sijil Aplikasi Perisian KomputerKOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
KOLEJ KOMUNITI - Sijil Aplikasi Perisian KomputerAiman Hud
 
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdfLabprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdffreddysarabia1
 
Given the following ADT definition of a stack to use stack .docx
Given the following ADT definition of a stack to use stack .docxGiven the following ADT definition of a stack to use stack .docx
Given the following ADT definition of a stack to use stack .docxshericehewat
 
Os Vanrossum
Os VanrossumOs Vanrossum
Os Vanrossumoscon2007
 
A topology of memory leaks on the JVM
A topology of memory leaks on the JVMA topology of memory leaks on the JVM
A topology of memory leaks on the JVMRafael Winterhalter
 
For each task, submit your source java code file.(1) Objective Im.pdf
For each task, submit your source java code file.(1) Objective Im.pdfFor each task, submit your source java code file.(1) Objective Im.pdf
For each task, submit your source java code file.(1) Objective Im.pdfdhavalbl38
 
131 Lab slides (all in one)
131 Lab slides (all in one)131 Lab slides (all in one)
131 Lab slides (all in one)Tak Lee
 
Educational slides by venay magen
Educational slides by venay magenEducational slides by venay magen
Educational slides by venay magenvenaymagen19
 
Extractors & Implicit conversions
Extractors & Implicit conversionsExtractors & Implicit conversions
Extractors & Implicit conversionsKnoldus Inc.
 

Similar to Oct13' ---- (20)

StackInterface An interface for the ADT stack. Do not modif.pdf
StackInterface An interface for the ADT stack. Do not modif.pdfStackInterface An interface for the ADT stack. Do not modif.pdf
StackInterface An interface for the ADT stack. Do not modif.pdf
 
(674335607) cs2309 java-lab-manual
(674335607) cs2309 java-lab-manual(674335607) cs2309 java-lab-manual
(674335607) cs2309 java-lab-manual
 
Utility.ppt
Utility.pptUtility.ppt
Utility.ppt
 
KOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
KOLEJ KOMUNITI - Sijil Aplikasi Perisian KomputerKOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
KOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
 
Sam wd programs
Sam wd programsSam wd programs
Sam wd programs
 
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdfLabprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
 
Oct27
Oct27Oct27
Oct27
 
linkedlist.pptx
linkedlist.pptxlinkedlist.pptx
linkedlist.pptx
 
Given the following ADT definition of a stack to use stack .docx
Given the following ADT definition of a stack to use stack .docxGiven the following ADT definition of a stack to use stack .docx
Given the following ADT definition of a stack to use stack .docx
 
Os Vanrossum
Os VanrossumOs Vanrossum
Os Vanrossum
 
Wrapper class
Wrapper classWrapper class
Wrapper class
 
Lecture 3.pptx
Lecture 3.pptxLecture 3.pptx
Lecture 3.pptx
 
STLStack.pdf
STLStack.pdfSTLStack.pdf
STLStack.pdf
 
A topology of memory leaks on the JVM
A topology of memory leaks on the JVMA topology of memory leaks on the JVM
A topology of memory leaks on the JVM
 
For each task, submit your source java code file.(1) Objective Im.pdf
For each task, submit your source java code file.(1) Objective Im.pdfFor each task, submit your source java code file.(1) Objective Im.pdf
For each task, submit your source java code file.(1) Objective Im.pdf
 
2 a stacks
2 a stacks2 a stacks
2 a stacks
 
131 Lab slides (all in one)
131 Lab slides (all in one)131 Lab slides (all in one)
131 Lab slides (all in one)
 
Educational slides by venay magen
Educational slides by venay magenEducational slides by venay magen
Educational slides by venay magen
 
C# labprograms
C# labprogramsC# labprograms
C# labprograms
 
Extractors & Implicit conversions
Extractors & Implicit conversionsExtractors & Implicit conversions
Extractors & Implicit conversions
 

Recently uploaded

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 

Recently uploaded (20)

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 

Oct13' ----

  • 1. Oct 13th Lab09. Stack, Heap, and Metaspace http://www.slideshare.net/takyeon
  • 2. public class Student { public String name; public int tokenLevel; private static int currentCount = 0; private static final int DEFAULT_TOKENS = 3; public Student() { name = "unknown"; tokenLevel = DEFAULT_TOKENS; currentCount++; } } Student s1 = new Student(); s1.name = "Tak"; currentCount 1 X DEFAULT_TOKENS constructor "unknown" STACK HEAP META SPACE 0 3 s1 name tokenLevel 3 "Tak" All static fields of a class live in Metaspace. All local variables (both primitives and references) live on the stack. Non-primitive data objects are stored in the heap, and referenced by variables on the stack. All non-primitive objects live on the heap. Primitive instance variables of those objects are stored inside the object. Non-primitive variables are stored outside of the object, and referenced by the instance variable.
  • 3. Size? 5 * *** ***** ******* ********* Scanner sc = new Scanner(System.in); int size = sc.nextInt(); for(int row=0; row<size; row++) { for(int col=0;col<4-row;col++) { System.out.print(" "); } for(int col=0;col<row*2+1;col++) { System.out.print("*"); } System.out.println(); } sc.close(); row col : 1st spaces before * col : 2nd number of * 0 4 1 1 3 3 2 2 5 3 1 7 4 0 9
  • 4. int x,y; x=2; y=5; System.out.println(x++ * y++); System.out.println(++x * ++y); System.out.println(++x * y++); System.out.println(x++ * ++y); System.out.println("1 + 2 = " + 1 + 2); System.out.println("1 + 2 = " + (1 + 2)); 1 + 2 = 12 1 + 2 = 3 year % 4 == 0 && year % 100 != 0 || year % 400 == 0 ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)