SlideShare a Scribd company logo
1 of 2
Download to read offline
In Db class we have two attributes/instance variables with the private visibility. meaning they
cannot be accessed outside of the class. Instance variables: name: data - type: String
Visibility/Access modifier: private name: yint - type: int Visibility/Access modifier: private Methods:
insertData - lets you set the values to above encapsulated instance variables. getData - getter
method for private data getYint - getter method for private yint setData -
for example:
Db db = new Db();
db.insertData("aaa",123);
System.out.println(db.getData());//aaa
System.out.println(db.getYint());//123
db.setData("zzz");
db.setYint(200);
System.out.println(db.getData());//zzz
System.out.println(db.getYint());//200
How to Submit?
//Create and use the object of Db class
// Use scanner class to provide data parameters
Example:
Input : Insert Data:
zzz
123
Output: zzz
123
Set Data:
123
zzz
write code in:
import java.util.*;
class Main {
public static void main(String[] args) {
//Your Code Here
System.out.println(db.getYint());
System.out.println(db.getData());
scanner.close();
}
}
write code in:
class Db {
//Your Code Here

More Related Content

Similar to In Db class we have two attributesinstance variables with t.pdf

DesignPatterns-IntroPresentation.pptx
DesignPatterns-IntroPresentation.pptxDesignPatterns-IntroPresentation.pptx
DesignPatterns-IntroPresentation.pptxMariusIoacara2
 
Classes and objects
Classes and objectsClasses and objects
Classes and objectsShahid Javid
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++rprajat007
 
Data migration to Drupal using Migrate Module
Data migration to Drupal using Migrate ModuleData migration to Drupal using Migrate Module
Data migration to Drupal using Migrate ModuleSrijan Technologies
 
psnreddy php-oops
psnreddy  php-oopspsnreddy  php-oops
psnreddy php-oopssatya552
 
Java căn bản - Chapter4
Java căn bản - Chapter4Java căn bản - Chapter4
Java căn bản - Chapter4Vince Vo
 
Chapter 4 - Defining Your Own Classes - Part I
Chapter 4 - Defining Your Own Classes - Part IChapter 4 - Defining Your Own Classes - Part I
Chapter 4 - Defining Your Own Classes - Part IEduardo Bergavera
 
Backbone.js: Run your Application Inside The Browser
Backbone.js: Run your Application Inside The BrowserBackbone.js: Run your Application Inside The Browser
Backbone.js: Run your Application Inside The BrowserHoward Lewis Ship
 
GR8Conf 2011: GORM Optimization
GR8Conf 2011: GORM OptimizationGR8Conf 2011: GORM Optimization
GR8Conf 2011: GORM OptimizationGR8Conf
 
Access controlaspecifier and visibilty modes
Access controlaspecifier and visibilty modesAccess controlaspecifier and visibilty modes
Access controlaspecifier and visibilty modesVinay Kumar
 
Classes and objects
Classes and objectsClasses and objects
Classes and objectsSaleem Thapa
 
C++ classes tutorials
C++ classes tutorialsC++ classes tutorials
C++ classes tutorialsMayank Jain
 
Chapter22 static-class-member-example
Chapter22 static-class-member-exampleChapter22 static-class-member-example
Chapter22 static-class-member-exampleDeepak Singh
 

Similar to In Db class we have two attributesinstance variables with t.pdf (20)

DesignPatterns-IntroPresentation.pptx
DesignPatterns-IntroPresentation.pptxDesignPatterns-IntroPresentation.pptx
DesignPatterns-IntroPresentation.pptx
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++
 
Lecture09
Lecture09Lecture09
Lecture09
 
Data migration to Drupal using Migrate Module
Data migration to Drupal using Migrate ModuleData migration to Drupal using Migrate Module
Data migration to Drupal using Migrate Module
 
psnreddy php-oops
psnreddy  php-oopspsnreddy  php-oops
psnreddy php-oops
 
Java căn bản - Chapter4
Java căn bản - Chapter4Java căn bản - Chapter4
Java căn bản - Chapter4
 
Chapter 4 - Defining Your Own Classes - Part I
Chapter 4 - Defining Your Own Classes - Part IChapter 4 - Defining Your Own Classes - Part I
Chapter 4 - Defining Your Own Classes - Part I
 
Backbone.js: Run your Application Inside The Browser
Backbone.js: Run your Application Inside The BrowserBackbone.js: Run your Application Inside The Browser
Backbone.js: Run your Application Inside The Browser
 
GR8Conf 2011: GORM Optimization
GR8Conf 2011: GORM OptimizationGR8Conf 2011: GORM Optimization
GR8Conf 2011: GORM Optimization
 
Access controlaspecifier and visibilty modes
Access controlaspecifier and visibilty modesAccess controlaspecifier and visibilty modes
Access controlaspecifier and visibilty modes
 
00ps inheritace using c++
00ps inheritace using c++00ps inheritace using c++
00ps inheritace using c++
 
About Data::ObjectDriver
About Data::ObjectDriverAbout Data::ObjectDriver
About Data::ObjectDriver
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
 
C++ classes
C++ classesC++ classes
C++ classes
 
class c++
class c++class c++
class c++
 
Lecture07
Lecture07Lecture07
Lecture07
 
C++ classes tutorials
C++ classes tutorialsC++ classes tutorials
C++ classes tutorials
 
Chapter22 static-class-member-example
Chapter22 static-class-member-exampleChapter22 static-class-member-example
Chapter22 static-class-member-example
 
Reflection
ReflectionReflection
Reflection
 

More from adithyaups

In Drosophila white eyes w and yellow body y are both r.pdf
In Drosophila white eyes w and yellow body y are both r.pdfIn Drosophila white eyes w and yellow body y are both r.pdf
In Drosophila white eyes w and yellow body y are both r.pdfadithyaups
 
In Drosophila vestigial wings is an autosomal recessive tra.pdf
In Drosophila vestigial wings is an autosomal recessive tra.pdfIn Drosophila vestigial wings is an autosomal recessive tra.pdf
In Drosophila vestigial wings is an autosomal recessive tra.pdfadithyaups
 
In Java Please Write a program AirplanSeatingAssignment.pdf
In Java Please   Write a program AirplanSeatingAssignment.pdfIn Java Please   Write a program AirplanSeatingAssignment.pdf
In Java Please Write a program AirplanSeatingAssignment.pdfadithyaups
 
In java Develop a menubased shapemaker using randomly gen.pdf
In java Develop a menubased shapemaker using randomly gen.pdfIn java Develop a menubased shapemaker using randomly gen.pdf
In java Develop a menubased shapemaker using randomly gen.pdfadithyaups
 
IN JAVA Develop a menubased shapemaker using randomly g.pdf
IN JAVA   Develop a menubased shapemaker using randomly g.pdfIN JAVA   Develop a menubased shapemaker using randomly g.pdf
IN JAVA Develop a menubased shapemaker using randomly g.pdfadithyaups
 
In hindsight Bitcoin experienced a speculative bubble Whic.pdf
In hindsight Bitcoin experienced a speculative bubble Whic.pdfIn hindsight Bitcoin experienced a speculative bubble Whic.pdf
In hindsight Bitcoin experienced a speculative bubble Whic.pdfadithyaups
 
in Figure 233 shows the different types Filiform papillae .pdf
in Figure 233 shows the different types Filiform papillae .pdfin Figure 233 shows the different types Filiform papillae .pdf
in Figure 233 shows the different types Filiform papillae .pdfadithyaups
 
In his analysis of the Dell fraud for Forbes Edward Hess co.pdf
In his analysis of the Dell fraud for Forbes Edward Hess co.pdfIn his analysis of the Dell fraud for Forbes Edward Hess co.pdf
In his analysis of the Dell fraud for Forbes Edward Hess co.pdfadithyaups
 
In his efforts to mobilize action learning and change in th.pdf
In his efforts to mobilize action learning and change in th.pdfIn his efforts to mobilize action learning and change in th.pdf
In his efforts to mobilize action learning and change in th.pdfadithyaups
 
In humans being a tongue roller R is dominant to being a .pdf
In humans being a tongue roller R is dominant to being a .pdfIn humans being a tongue roller R is dominant to being a .pdf
In humans being a tongue roller R is dominant to being a .pdfadithyaups
 
In HBS case studies Nextel Peru and Globalization of Cost of.pdf
In HBS case studies Nextel Peru and Globalization of Cost of.pdfIn HBS case studies Nextel Peru and Globalization of Cost of.pdf
In HBS case studies Nextel Peru and Globalization of Cost of.pdfadithyaups
 
in gibi g mesafesinin yksek olduu lkelerde alanlarn a.pdf
in gibi g mesafesinin yksek olduu lkelerde alanlarn a.pdfin gibi g mesafesinin yksek olduu lkelerde alanlarn a.pdf
in gibi g mesafesinin yksek olduu lkelerde alanlarn a.pdfadithyaups
 
In Figure 83 there are black squiggles in the RER compar.pdf
In Figure 83 there are black squiggles in the RER compar.pdfIn Figure 83 there are black squiggles in the RER compar.pdf
In Figure 83 there are black squiggles in the RER compar.pdfadithyaups
 
In early 2015 Ford Motor F had a book value of equity of .pdf
In early 2015 Ford Motor F had a book value of equity of .pdfIn early 2015 Ford Motor F had a book value of equity of .pdf
In early 2015 Ford Motor F had a book value of equity of .pdfadithyaups
 
In dogs locus B determines pigment color Bblack bbrown p.pdf
In dogs locus B determines pigment color Bblack bbrown p.pdfIn dogs locus B determines pigment color Bblack bbrown p.pdf
In dogs locus B determines pigment color Bblack bbrown p.pdfadithyaups
 
In Block 1 Week 3 there is a description of various social.pdf
In Block 1 Week 3 there is a description of various social.pdfIn Block 1 Week 3 there is a description of various social.pdf
In Block 1 Week 3 there is a description of various social.pdfadithyaups
 
In each of the following cases report the appropriate diagn.pdf
In each of the following cases report the appropriate diagn.pdfIn each of the following cases report the appropriate diagn.pdf
In each of the following cases report the appropriate diagn.pdfadithyaups
 
In descriptive statistics the term standard error refers .pdf
In descriptive statistics the term standard error refers .pdfIn descriptive statistics the term standard error refers .pdf
In descriptive statistics the term standard error refers .pdfadithyaups
 
In catastropheFamine phase the action required is Action r.pdf
In catastropheFamine phase the action required is Action r.pdfIn catastropheFamine phase the action required is Action r.pdf
In catastropheFamine phase the action required is Action r.pdfadithyaups
 
In cell H5 enter a formula using the SUME function to searc.pdf
In cell H5 enter a formula using the SUME function to searc.pdfIn cell H5 enter a formula using the SUME function to searc.pdf
In cell H5 enter a formula using the SUME function to searc.pdfadithyaups
 

More from adithyaups (20)

In Drosophila white eyes w and yellow body y are both r.pdf
In Drosophila white eyes w and yellow body y are both r.pdfIn Drosophila white eyes w and yellow body y are both r.pdf
In Drosophila white eyes w and yellow body y are both r.pdf
 
In Drosophila vestigial wings is an autosomal recessive tra.pdf
In Drosophila vestigial wings is an autosomal recessive tra.pdfIn Drosophila vestigial wings is an autosomal recessive tra.pdf
In Drosophila vestigial wings is an autosomal recessive tra.pdf
 
In Java Please Write a program AirplanSeatingAssignment.pdf
In Java Please   Write a program AirplanSeatingAssignment.pdfIn Java Please   Write a program AirplanSeatingAssignment.pdf
In Java Please Write a program AirplanSeatingAssignment.pdf
 
In java Develop a menubased shapemaker using randomly gen.pdf
In java Develop a menubased shapemaker using randomly gen.pdfIn java Develop a menubased shapemaker using randomly gen.pdf
In java Develop a menubased shapemaker using randomly gen.pdf
 
IN JAVA Develop a menubased shapemaker using randomly g.pdf
IN JAVA   Develop a menubased shapemaker using randomly g.pdfIN JAVA   Develop a menubased shapemaker using randomly g.pdf
IN JAVA Develop a menubased shapemaker using randomly g.pdf
 
In hindsight Bitcoin experienced a speculative bubble Whic.pdf
In hindsight Bitcoin experienced a speculative bubble Whic.pdfIn hindsight Bitcoin experienced a speculative bubble Whic.pdf
In hindsight Bitcoin experienced a speculative bubble Whic.pdf
 
in Figure 233 shows the different types Filiform papillae .pdf
in Figure 233 shows the different types Filiform papillae .pdfin Figure 233 shows the different types Filiform papillae .pdf
in Figure 233 shows the different types Filiform papillae .pdf
 
In his analysis of the Dell fraud for Forbes Edward Hess co.pdf
In his analysis of the Dell fraud for Forbes Edward Hess co.pdfIn his analysis of the Dell fraud for Forbes Edward Hess co.pdf
In his analysis of the Dell fraud for Forbes Edward Hess co.pdf
 
In his efforts to mobilize action learning and change in th.pdf
In his efforts to mobilize action learning and change in th.pdfIn his efforts to mobilize action learning and change in th.pdf
In his efforts to mobilize action learning and change in th.pdf
 
In humans being a tongue roller R is dominant to being a .pdf
In humans being a tongue roller R is dominant to being a .pdfIn humans being a tongue roller R is dominant to being a .pdf
In humans being a tongue roller R is dominant to being a .pdf
 
In HBS case studies Nextel Peru and Globalization of Cost of.pdf
In HBS case studies Nextel Peru and Globalization of Cost of.pdfIn HBS case studies Nextel Peru and Globalization of Cost of.pdf
In HBS case studies Nextel Peru and Globalization of Cost of.pdf
 
in gibi g mesafesinin yksek olduu lkelerde alanlarn a.pdf
in gibi g mesafesinin yksek olduu lkelerde alanlarn a.pdfin gibi g mesafesinin yksek olduu lkelerde alanlarn a.pdf
in gibi g mesafesinin yksek olduu lkelerde alanlarn a.pdf
 
In Figure 83 there are black squiggles in the RER compar.pdf
In Figure 83 there are black squiggles in the RER compar.pdfIn Figure 83 there are black squiggles in the RER compar.pdf
In Figure 83 there are black squiggles in the RER compar.pdf
 
In early 2015 Ford Motor F had a book value of equity of .pdf
In early 2015 Ford Motor F had a book value of equity of .pdfIn early 2015 Ford Motor F had a book value of equity of .pdf
In early 2015 Ford Motor F had a book value of equity of .pdf
 
In dogs locus B determines pigment color Bblack bbrown p.pdf
In dogs locus B determines pigment color Bblack bbrown p.pdfIn dogs locus B determines pigment color Bblack bbrown p.pdf
In dogs locus B determines pigment color Bblack bbrown p.pdf
 
In Block 1 Week 3 there is a description of various social.pdf
In Block 1 Week 3 there is a description of various social.pdfIn Block 1 Week 3 there is a description of various social.pdf
In Block 1 Week 3 there is a description of various social.pdf
 
In each of the following cases report the appropriate diagn.pdf
In each of the following cases report the appropriate diagn.pdfIn each of the following cases report the appropriate diagn.pdf
In each of the following cases report the appropriate diagn.pdf
 
In descriptive statistics the term standard error refers .pdf
In descriptive statistics the term standard error refers .pdfIn descriptive statistics the term standard error refers .pdf
In descriptive statistics the term standard error refers .pdf
 
In catastropheFamine phase the action required is Action r.pdf
In catastropheFamine phase the action required is Action r.pdfIn catastropheFamine phase the action required is Action r.pdf
In catastropheFamine phase the action required is Action r.pdf
 
In cell H5 enter a formula using the SUME function to searc.pdf
In cell H5 enter a formula using the SUME function to searc.pdfIn cell H5 enter a formula using the SUME function to searc.pdf
In cell H5 enter a formula using the SUME function to searc.pdf
 

Recently uploaded

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
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
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
 

Recently uploaded (20)

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
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
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
 
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
 

In Db class we have two attributesinstance variables with t.pdf

  • 1. In Db class we have two attributes/instance variables with the private visibility. meaning they cannot be accessed outside of the class. Instance variables: name: data - type: String Visibility/Access modifier: private name: yint - type: int Visibility/Access modifier: private Methods: insertData - lets you set the values to above encapsulated instance variables. getData - getter method for private data getYint - getter method for private yint setData - for example: Db db = new Db(); db.insertData("aaa",123); System.out.println(db.getData());//aaa System.out.println(db.getYint());//123 db.setData("zzz"); db.setYint(200); System.out.println(db.getData());//zzz System.out.println(db.getYint());//200 How to Submit? //Create and use the object of Db class // Use scanner class to provide data parameters Example: Input : Insert Data: zzz 123 Output: zzz 123 Set Data: 123 zzz write code in: import java.util.*; class Main { public static void main(String[] args) { //Your Code Here System.out.println(db.getYint()); System.out.println(db.getData()); scanner.close(); } }
  • 2. write code in: class Db { //Your Code Here