SlideShare a Scribd company logo
1 of 8
Download to read offline
Listing.java
import java.util.Scanner;
public class Listing {
//Declaring instance variables
private String name;
private int age;
//Default constructor
public Listing() {
name=" ";
age=0;
}
//parameterized Constructor
public Listing(String name, int age) {
super();
this.name = name;
this.age = age;
}
//Getters and setters
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
//This input() method will take the inputs entered by the user.
public void input()
{
//Scanner Object is used to get the data entered by the user
Scanner sc=new Scanner(System.in);
//Getting the user name
System.out.print("Enter Name :");
setName(sc.nextLine());
//Getting the Age
System.out.print("Enter Age :");
setAge(sc.nextInt());
}
//This toString() method will displays the constents of the user.
@Override
public String toString() {
System.out.println("Name :"+getName());
System.out.println("Name :"+getAge());
return "";
}
}
_____________________________________________________________
Driver.java
public class Driver {
public static void main(String[] args) {
//Create an array of 3 Listing Objects
Listing listing[]=new Listing[3];
//Creating Listing Objects and populating into an Array
for(int i=0;i<3;i++)
{
listing[i]=new Listing();
System.out.println("Listing Object "+(i+1)+":");
//Calling the input method which capture the data entered by the user
listing[i].input();
}
//Displaying the Listing objects in the Normal Order
System.out.println("Displaying the Listing Objects in the Normal Order ::");
for(int i=0;i<3;i++)
{
System.out.println("Listing Object "+(i+1)+":");
listing[i].toString();
System.out.println("_____________________");
}
//Displaying the Listing objects in the Reverse Order
System.out.println("Displaying the Listing Objects in the Reverse Order ::");
for(int i=2;i>=0;i--)
{
System.out.println("Listing Object "+(i+1)+":");
listing[i].toString();
System.out.println("_____________________");
}
}
}
_______________________________________________________
Output:
Listing Object 1:
Enter Name :Kane Williams
Enter Age :27
Listing Object 2:
Enter Name :John Mills
Enter Age :23
Listing Object 3:
Enter Name :Tim Rochey
Enter Age :22
Displaying the Listing Objects in the Normal Order ::
Listing Object 1:
Name :Kane Williams
Name :27
_____________________
Listing Object 2:
Name :John Mills
Name :23
_____________________
Listing Object 3:
Name :Tim Rochey
Name :22
_____________________
Displaying the Listing Objects in the Reverse Order ::
Listing Object 3:
Name :Tim Rochey
Name :22
_____________________
Listing Object 2:
Name :John Mills
Name :23
_____________________
Listing Object 1:
Name :Kane Williams
Name :27
_____________________
_____________________________________________Thank You
Solution
Listing.java
import java.util.Scanner;
public class Listing {
//Declaring instance variables
private String name;
private int age;
//Default constructor
public Listing() {
name=" ";
age=0;
}
//parameterized Constructor
public Listing(String name, int age) {
super();
this.name = name;
this.age = age;
}
//Getters and setters
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
//This input() method will take the inputs entered by the user.
public void input()
{
//Scanner Object is used to get the data entered by the user
Scanner sc=new Scanner(System.in);
//Getting the user name
System.out.print("Enter Name :");
setName(sc.nextLine());
//Getting the Age
System.out.print("Enter Age :");
setAge(sc.nextInt());
}
//This toString() method will displays the constents of the user.
@Override
public String toString() {
System.out.println("Name :"+getName());
System.out.println("Name :"+getAge());
return "";
}
}
_____________________________________________________________
Driver.java
public class Driver {
public static void main(String[] args) {
//Create an array of 3 Listing Objects
Listing listing[]=new Listing[3];
//Creating Listing Objects and populating into an Array
for(int i=0;i<3;i++)
{
listing[i]=new Listing();
System.out.println("Listing Object "+(i+1)+":");
//Calling the input method which capture the data entered by the user
listing[i].input();
}
//Displaying the Listing objects in the Normal Order
System.out.println("Displaying the Listing Objects in the Normal Order ::");
for(int i=0;i<3;i++)
{
System.out.println("Listing Object "+(i+1)+":");
listing[i].toString();
System.out.println("_____________________");
}
//Displaying the Listing objects in the Reverse Order
System.out.println("Displaying the Listing Objects in the Reverse Order ::");
for(int i=2;i>=0;i--)
{
System.out.println("Listing Object "+(i+1)+":");
listing[i].toString();
System.out.println("_____________________");
}
}
}
_______________________________________________________
Output:
Listing Object 1:
Enter Name :Kane Williams
Enter Age :27
Listing Object 2:
Enter Name :John Mills
Enter Age :23
Listing Object 3:
Enter Name :Tim Rochey
Enter Age :22
Displaying the Listing Objects in the Normal Order ::
Listing Object 1:
Name :Kane Williams
Name :27
_____________________
Listing Object 2:
Name :John Mills
Name :23
_____________________
Listing Object 3:
Name :Tim Rochey
Name :22
_____________________
Displaying the Listing Objects in the Reverse Order ::
Listing Object 3:
Name :Tim Rochey
Name :22
_____________________
Listing Object 2:
Name :John Mills
Name :23
_____________________
Listing Object 1:
Name :Kane Williams
Name :27
_____________________
_____________________________________________Thank You

More Related Content

Similar to Listing.javaimport java.util.Scanner;public class Listing {   .pdf

Code to copy Person.java .pdf
Code to copy Person.java .pdfCode to copy Person.java .pdf
Code to copy Person.java .pdfanokhijew
 
BasicPizza.javapublic class BasicPizza { Declaring instance .pdf
BasicPizza.javapublic class BasicPizza { Declaring instance .pdfBasicPizza.javapublic class BasicPizza { Declaring instance .pdf
BasicPizza.javapublic class BasicPizza { Declaring instance .pdfankitmobileshop235
 
assignmentTwoCar.javaassignmentTwoCar.javapackage assignmentTw.docx
assignmentTwoCar.javaassignmentTwoCar.javapackage assignmentTw.docxassignmentTwoCar.javaassignmentTwoCar.javapackage assignmentTw.docx
assignmentTwoCar.javaassignmentTwoCar.javapackage assignmentTw.docxssuser562afc1
 
Repeat Programming Project 2 in Chapter 5. This time, add the follow.pdf
Repeat Programming Project 2 in Chapter 5. This time, add the follow.pdfRepeat Programming Project 2 in Chapter 5. This time, add the follow.pdf
Repeat Programming Project 2 in Chapter 5. This time, add the follow.pdfarracollection
 
So Far I have these two classes but I need help with my persontest c.pdf
So Far I have these two classes but I need help with my persontest c.pdfSo Far I have these two classes but I need help with my persontest c.pdf
So Far I have these two classes but I need help with my persontest c.pdfarihantgiftgallery
 
Create a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdfCreate a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdflakshmijewellery
 
Kotlin Data Model
Kotlin Data ModelKotlin Data Model
Kotlin Data ModelKros Huang
 
java question Fill the add statement areaProject is to wo.pdf
java question Fill the add statement areaProject is to wo.pdfjava question Fill the add statement areaProject is to wo.pdf
java question Fill the add statement areaProject is to wo.pdfdbrienmhompsonkath75
 
Defining classes-and-objects-1.0
Defining classes-and-objects-1.0Defining classes-and-objects-1.0
Defining classes-and-objects-1.0BG Java EE Course
 
運用Closure Compiler 打造高品質的JavaScript
運用Closure Compiler 打造高品質的JavaScript運用Closure Compiler 打造高品質的JavaScript
運用Closure Compiler 打造高品質的JavaScripttaobao.com
 
operating system linux,ubuntu,Mac Geometri.pdf
operating system linux,ubuntu,Mac Geometri.pdfoperating system linux,ubuntu,Mac Geometri.pdf
operating system linux,ubuntu,Mac Geometri.pdfaquadreammail
 
when I compile to get the survey title the overload constructor asks.docx
when I compile to get the survey title the overload constructor asks.docxwhen I compile to get the survey title the overload constructor asks.docx
when I compile to get the survey title the overload constructor asks.docxlashandaotley
 
Overview You are tasked with writing a program called Social Security.pdf
Overview You are tasked with writing a program called Social Security.pdfOverview You are tasked with writing a program called Social Security.pdf
Overview You are tasked with writing a program called Social Security.pdfinfo961251
 
define a class name Employee whose objects are records for employee..pdf
define a class name Employee whose objects are records for employee..pdfdefine a class name Employee whose objects are records for employee..pdf
define a class name Employee whose objects are records for employee..pdffashioncollection2
 
Java questionI am having issues returning the score sort in numeri.pdf
Java questionI am having issues returning the score sort in numeri.pdfJava questionI am having issues returning the score sort in numeri.pdf
Java questionI am having issues returning the score sort in numeri.pdfforwardcom41
 
There is something wrong with my program-- (once I do a for view all t.pdf
There is something wrong with my program-- (once I do a for view all t.pdfThere is something wrong with my program-- (once I do a for view all t.pdf
There is something wrong with my program-- (once I do a for view all t.pdfaashienterprisesuk
 
How to fix this error- Exception in thread -main- q- Exit java-lang-.pdf
How to fix this error-   Exception in thread -main- q- Exit java-lang-.pdfHow to fix this error-   Exception in thread -main- q- Exit java-lang-.pdf
How to fix this error- Exception in thread -main- q- Exit java-lang-.pdfaarokyaaqua
 
CodeCamp Iasi 10 march 2012 - Practical Groovy
CodeCamp Iasi 10 march 2012 - Practical GroovyCodeCamp Iasi 10 march 2012 - Practical Groovy
CodeCamp Iasi 10 march 2012 - Practical GroovyCodecamp Romania
 

Similar to Listing.javaimport java.util.Scanner;public class Listing {   .pdf (20)

Code to copy Person.java .pdf
Code to copy Person.java .pdfCode to copy Person.java .pdf
Code to copy Person.java .pdf
 
OOP Lab Report.docx
OOP Lab Report.docxOOP Lab Report.docx
OOP Lab Report.docx
 
BasicPizza.javapublic class BasicPizza { Declaring instance .pdf
BasicPizza.javapublic class BasicPizza { Declaring instance .pdfBasicPizza.javapublic class BasicPizza { Declaring instance .pdf
BasicPizza.javapublic class BasicPizza { Declaring instance .pdf
 
assignmentTwoCar.javaassignmentTwoCar.javapackage assignmentTw.docx
assignmentTwoCar.javaassignmentTwoCar.javapackage assignmentTw.docxassignmentTwoCar.javaassignmentTwoCar.javapackage assignmentTw.docx
assignmentTwoCar.javaassignmentTwoCar.javapackage assignmentTw.docx
 
Repeat Programming Project 2 in Chapter 5. This time, add the follow.pdf
Repeat Programming Project 2 in Chapter 5. This time, add the follow.pdfRepeat Programming Project 2 in Chapter 5. This time, add the follow.pdf
Repeat Programming Project 2 in Chapter 5. This time, add the follow.pdf
 
So Far I have these two classes but I need help with my persontest c.pdf
So Far I have these two classes but I need help with my persontest c.pdfSo Far I have these two classes but I need help with my persontest c.pdf
So Far I have these two classes but I need help with my persontest c.pdf
 
Create a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdfCreate a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdf
 
Kotlin Data Model
Kotlin Data ModelKotlin Data Model
Kotlin Data Model
 
java question Fill the add statement areaProject is to wo.pdf
java question Fill the add statement areaProject is to wo.pdfjava question Fill the add statement areaProject is to wo.pdf
java question Fill the add statement areaProject is to wo.pdf
 
Defining classes-and-objects-1.0
Defining classes-and-objects-1.0Defining classes-and-objects-1.0
Defining classes-and-objects-1.0
 
Logincode
LogincodeLogincode
Logincode
 
運用Closure Compiler 打造高品質的JavaScript
運用Closure Compiler 打造高品質的JavaScript運用Closure Compiler 打造高品質的JavaScript
運用Closure Compiler 打造高品質的JavaScript
 
operating system linux,ubuntu,Mac Geometri.pdf
operating system linux,ubuntu,Mac Geometri.pdfoperating system linux,ubuntu,Mac Geometri.pdf
operating system linux,ubuntu,Mac Geometri.pdf
 
when I compile to get the survey title the overload constructor asks.docx
when I compile to get the survey title the overload constructor asks.docxwhen I compile to get the survey title the overload constructor asks.docx
when I compile to get the survey title the overload constructor asks.docx
 
Overview You are tasked with writing a program called Social Security.pdf
Overview You are tasked with writing a program called Social Security.pdfOverview You are tasked with writing a program called Social Security.pdf
Overview You are tasked with writing a program called Social Security.pdf
 
define a class name Employee whose objects are records for employee..pdf
define a class name Employee whose objects are records for employee..pdfdefine a class name Employee whose objects are records for employee..pdf
define a class name Employee whose objects are records for employee..pdf
 
Java questionI am having issues returning the score sort in numeri.pdf
Java questionI am having issues returning the score sort in numeri.pdfJava questionI am having issues returning the score sort in numeri.pdf
Java questionI am having issues returning the score sort in numeri.pdf
 
There is something wrong with my program-- (once I do a for view all t.pdf
There is something wrong with my program-- (once I do a for view all t.pdfThere is something wrong with my program-- (once I do a for view all t.pdf
There is something wrong with my program-- (once I do a for view all t.pdf
 
How to fix this error- Exception in thread -main- q- Exit java-lang-.pdf
How to fix this error-   Exception in thread -main- q- Exit java-lang-.pdfHow to fix this error-   Exception in thread -main- q- Exit java-lang-.pdf
How to fix this error- Exception in thread -main- q- Exit java-lang-.pdf
 
CodeCamp Iasi 10 march 2012 - Practical Groovy
CodeCamp Iasi 10 march 2012 - Practical GroovyCodeCamp Iasi 10 march 2012 - Practical Groovy
CodeCamp Iasi 10 march 2012 - Practical Groovy
 

More from Ankitchhabra28

frequency tableSolution frequency table.pdf
 frequency tableSolution frequency table.pdf frequency tableSolution frequency table.pdf
frequency tableSolution frequency table.pdfAnkitchhabra28
 
ublic class Elevator { private static final String DOWN = down.pdf
  ublic class Elevator {     private static final String DOWN = down.pdf  ublic class Elevator {     private static final String DOWN = down.pdf
ublic class Elevator { private static final String DOWN = down.pdfAnkitchhabra28
 
[Al+] [OH-]^3 = Ksp0.2 [OH-]^3 = 210^-32[OH-] = 4.64210^-1.pdf
[Al+]  [OH-]^3 = Ksp0.2  [OH-]^3 = 210^-32[OH-] = 4.64210^-1.pdf[Al+]  [OH-]^3 = Ksp0.2  [OH-]^3 = 210^-32[OH-] = 4.64210^-1.pdf
[Al+] [OH-]^3 = Ksp0.2 [OH-]^3 = 210^-32[OH-] = 4.64210^-1.pdfAnkitchhabra28
 
As a CFO environment of internal control needs to put in place t.pdf
    As a CFO environment of internal control needs to put in   place t.pdf    As a CFO environment of internal control needs to put in   place t.pdf
As a CFO environment of internal control needs to put in place t.pdfAnkitchhabra28
 
What are the financial markets and what purposes do they serveA f.pdf
What are the financial markets and what purposes do they serveA f.pdfWhat are the financial markets and what purposes do they serveA f.pdf
What are the financial markets and what purposes do they serveA f.pdfAnkitchhabra28
 
VI) Instruction set Architecture-      Instruction set is a colle.pdf
VI) Instruction set Architecture-      Instruction set is a colle.pdfVI) Instruction set Architecture-      Instruction set is a colle.pdf
VI) Instruction set Architecture-      Instruction set is a colle.pdfAnkitchhabra28
 
The OSI(Open System Interconnection) contains 7 layers.1.Physica.pdf
The OSI(Open System Interconnection) contains 7 layers.1.Physica.pdfThe OSI(Open System Interconnection) contains 7 layers.1.Physica.pdf
The OSI(Open System Interconnection) contains 7 layers.1.Physica.pdfAnkitchhabra28
 
the following statements are true Ubiquinone is a small, hydrophob.pdf
the following statements are true Ubiquinone is a small, hydrophob.pdfthe following statements are true Ubiquinone is a small, hydrophob.pdf
the following statements are true Ubiquinone is a small, hydrophob.pdfAnkitchhabra28
 
The evolution of one species is driven by the evolution of the other.pdf
The evolution of one species is driven by the evolution of the other.pdfThe evolution of one species is driven by the evolution of the other.pdf
The evolution of one species is driven by the evolution of the other.pdfAnkitchhabra28
 
Student choosed wrong subject. Question was not showning.Solutio.pdf
Student choosed wrong subject. Question was not showning.Solutio.pdfStudent choosed wrong subject. Question was not showning.Solutio.pdf
Student choosed wrong subject. Question was not showning.Solutio.pdfAnkitchhabra28
 
S(sulfur) atom Glucose molecule and compound Oxygen atom DN.pdf
S(sulfur) atom Glucose molecule and compound Oxygen atom DN.pdfS(sulfur) atom Glucose molecule and compound Oxygen atom DN.pdf
S(sulfur) atom Glucose molecule and compound Oxygen atom DN.pdfAnkitchhabra28
 
Question not visible..please post the imageSolutionQuestion no.pdf
Question not visible..please post the imageSolutionQuestion no.pdfQuestion not visible..please post the imageSolutionQuestion no.pdf
Question not visible..please post the imageSolutionQuestion no.pdfAnkitchhabra28
 
Program 1 public class QueueUsingArray { private static final i.pdf
Program 1 public class QueueUsingArray { private static final i.pdfProgram 1 public class QueueUsingArray { private static final i.pdf
Program 1 public class QueueUsingArray { private static final i.pdfAnkitchhabra28
 
PrimeRange.java import java.util.Scanner;public class PrimeRan.pdf
PrimeRange.java import java.util.Scanner;public class PrimeRan.pdfPrimeRange.java import java.util.Scanner;public class PrimeRan.pdf
PrimeRange.java import java.util.Scanner;public class PrimeRan.pdfAnkitchhabra28
 
opps no format is there...Solutionopps no format is there....pdf
opps no format is there...Solutionopps no format is there....pdfopps no format is there...Solutionopps no format is there....pdf
opps no format is there...Solutionopps no format is there....pdfAnkitchhabra28
 
Note             Given Code modified as required and required met.pdf
Note             Given Code modified as required and required met.pdfNote             Given Code modified as required and required met.pdf
Note             Given Code modified as required and required met.pdfAnkitchhabra28
 
No, weight is not the measure of quantity of matter.Quantity of ma.pdf
No, weight is not the measure of quantity of matter.Quantity of ma.pdfNo, weight is not the measure of quantity of matter.Quantity of ma.pdf
No, weight is not the measure of quantity of matter.Quantity of ma.pdfAnkitchhabra28
 
Two. The pyruvate with carbons 4-6 will go throu.pdf
                     Two.  The pyruvate with carbons 4-6 will go throu.pdf                     Two.  The pyruvate with carbons 4-6 will go throu.pdf
Two. The pyruvate with carbons 4-6 will go throu.pdfAnkitchhabra28
 
is rightSolutionis right.pdf
is rightSolutionis right.pdfis rightSolutionis right.pdf
is rightSolutionis right.pdfAnkitchhabra28
 

More from Ankitchhabra28 (20)

frequency tableSolution frequency table.pdf
 frequency tableSolution frequency table.pdf frequency tableSolution frequency table.pdf
frequency tableSolution frequency table.pdf
 
ublic class Elevator { private static final String DOWN = down.pdf
  ublic class Elevator {     private static final String DOWN = down.pdf  ublic class Elevator {     private static final String DOWN = down.pdf
ublic class Elevator { private static final String DOWN = down.pdf
 
[Al+] [OH-]^3 = Ksp0.2 [OH-]^3 = 210^-32[OH-] = 4.64210^-1.pdf
[Al+]  [OH-]^3 = Ksp0.2  [OH-]^3 = 210^-32[OH-] = 4.64210^-1.pdf[Al+]  [OH-]^3 = Ksp0.2  [OH-]^3 = 210^-32[OH-] = 4.64210^-1.pdf
[Al+] [OH-]^3 = Ksp0.2 [OH-]^3 = 210^-32[OH-] = 4.64210^-1.pdf
 
As a CFO environment of internal control needs to put in place t.pdf
    As a CFO environment of internal control needs to put in   place t.pdf    As a CFO environment of internal control needs to put in   place t.pdf
As a CFO environment of internal control needs to put in place t.pdf
 
What are the financial markets and what purposes do they serveA f.pdf
What are the financial markets and what purposes do they serveA f.pdfWhat are the financial markets and what purposes do they serveA f.pdf
What are the financial markets and what purposes do they serveA f.pdf
 
VI) Instruction set Architecture-      Instruction set is a colle.pdf
VI) Instruction set Architecture-      Instruction set is a colle.pdfVI) Instruction set Architecture-      Instruction set is a colle.pdf
VI) Instruction set Architecture-      Instruction set is a colle.pdf
 
waitSolutionwait.pdf
waitSolutionwait.pdfwaitSolutionwait.pdf
waitSolutionwait.pdf
 
The OSI(Open System Interconnection) contains 7 layers.1.Physica.pdf
The OSI(Open System Interconnection) contains 7 layers.1.Physica.pdfThe OSI(Open System Interconnection) contains 7 layers.1.Physica.pdf
The OSI(Open System Interconnection) contains 7 layers.1.Physica.pdf
 
the following statements are true Ubiquinone is a small, hydrophob.pdf
the following statements are true Ubiquinone is a small, hydrophob.pdfthe following statements are true Ubiquinone is a small, hydrophob.pdf
the following statements are true Ubiquinone is a small, hydrophob.pdf
 
The evolution of one species is driven by the evolution of the other.pdf
The evolution of one species is driven by the evolution of the other.pdfThe evolution of one species is driven by the evolution of the other.pdf
The evolution of one species is driven by the evolution of the other.pdf
 
Student choosed wrong subject. Question was not showning.Solutio.pdf
Student choosed wrong subject. Question was not showning.Solutio.pdfStudent choosed wrong subject. Question was not showning.Solutio.pdf
Student choosed wrong subject. Question was not showning.Solutio.pdf
 
S(sulfur) atom Glucose molecule and compound Oxygen atom DN.pdf
S(sulfur) atom Glucose molecule and compound Oxygen atom DN.pdfS(sulfur) atom Glucose molecule and compound Oxygen atom DN.pdf
S(sulfur) atom Glucose molecule and compound Oxygen atom DN.pdf
 
Question not visible..please post the imageSolutionQuestion no.pdf
Question not visible..please post the imageSolutionQuestion no.pdfQuestion not visible..please post the imageSolutionQuestion no.pdf
Question not visible..please post the imageSolutionQuestion no.pdf
 
Program 1 public class QueueUsingArray { private static final i.pdf
Program 1 public class QueueUsingArray { private static final i.pdfProgram 1 public class QueueUsingArray { private static final i.pdf
Program 1 public class QueueUsingArray { private static final i.pdf
 
PrimeRange.java import java.util.Scanner;public class PrimeRan.pdf
PrimeRange.java import java.util.Scanner;public class PrimeRan.pdfPrimeRange.java import java.util.Scanner;public class PrimeRan.pdf
PrimeRange.java import java.util.Scanner;public class PrimeRan.pdf
 
opps no format is there...Solutionopps no format is there....pdf
opps no format is there...Solutionopps no format is there....pdfopps no format is there...Solutionopps no format is there....pdf
opps no format is there...Solutionopps no format is there....pdf
 
Note             Given Code modified as required and required met.pdf
Note             Given Code modified as required and required met.pdfNote             Given Code modified as required and required met.pdf
Note             Given Code modified as required and required met.pdf
 
No, weight is not the measure of quantity of matter.Quantity of ma.pdf
No, weight is not the measure of quantity of matter.Quantity of ma.pdfNo, weight is not the measure of quantity of matter.Quantity of ma.pdf
No, weight is not the measure of quantity of matter.Quantity of ma.pdf
 
Two. The pyruvate with carbons 4-6 will go throu.pdf
                     Two.  The pyruvate with carbons 4-6 will go throu.pdf                     Two.  The pyruvate with carbons 4-6 will go throu.pdf
Two. The pyruvate with carbons 4-6 will go throu.pdf
 
is rightSolutionis right.pdf
is rightSolutionis right.pdfis rightSolutionis right.pdf
is rightSolutionis right.pdf
 

Recently uploaded

Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnershipsexpandedwebsite
 
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.pptNishitharanjan Rout
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...Gary Wood
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................MirzaAbrarBaig5
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...Nguyen Thanh Tu Collection
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppCeline George
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxCeline George
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesPooky Knightsmith
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhleson0603
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17Celine George
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppCeline George
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFVivekanand Anglo Vedic Academy
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024Borja Sotomayor
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesAmanpreetKaur157993
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 

Recently uploaded (20)

Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
Supporting Newcomer Multilingual Learners
Supporting Newcomer  Multilingual LearnersSupporting Newcomer  Multilingual Learners
Supporting Newcomer Multilingual Learners
 
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
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"
 

Listing.javaimport java.util.Scanner;public class Listing {   .pdf

  • 1. Listing.java import java.util.Scanner; public class Listing { //Declaring instance variables private String name; private int age; //Default constructor public Listing() { name=" "; age=0; } //parameterized Constructor public Listing(String name, int age) { super(); this.name = name; this.age = age; } //Getters and setters public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } //This input() method will take the inputs entered by the user. public void input()
  • 2. { //Scanner Object is used to get the data entered by the user Scanner sc=new Scanner(System.in); //Getting the user name System.out.print("Enter Name :"); setName(sc.nextLine()); //Getting the Age System.out.print("Enter Age :"); setAge(sc.nextInt()); } //This toString() method will displays the constents of the user. @Override public String toString() { System.out.println("Name :"+getName()); System.out.println("Name :"+getAge()); return ""; } } _____________________________________________________________ Driver.java public class Driver { public static void main(String[] args) { //Create an array of 3 Listing Objects Listing listing[]=new Listing[3]; //Creating Listing Objects and populating into an Array for(int i=0;i<3;i++) { listing[i]=new Listing(); System.out.println("Listing Object "+(i+1)+":"); //Calling the input method which capture the data entered by the user
  • 3. listing[i].input(); } //Displaying the Listing objects in the Normal Order System.out.println("Displaying the Listing Objects in the Normal Order ::"); for(int i=0;i<3;i++) { System.out.println("Listing Object "+(i+1)+":"); listing[i].toString(); System.out.println("_____________________"); } //Displaying the Listing objects in the Reverse Order System.out.println("Displaying the Listing Objects in the Reverse Order ::"); for(int i=2;i>=0;i--) { System.out.println("Listing Object "+(i+1)+":"); listing[i].toString(); System.out.println("_____________________"); } } } _______________________________________________________ Output: Listing Object 1: Enter Name :Kane Williams Enter Age :27 Listing Object 2: Enter Name :John Mills Enter Age :23 Listing Object 3: Enter Name :Tim Rochey Enter Age :22 Displaying the Listing Objects in the Normal Order :: Listing Object 1:
  • 4. Name :Kane Williams Name :27 _____________________ Listing Object 2: Name :John Mills Name :23 _____________________ Listing Object 3: Name :Tim Rochey Name :22 _____________________ Displaying the Listing Objects in the Reverse Order :: Listing Object 3: Name :Tim Rochey Name :22 _____________________ Listing Object 2: Name :John Mills Name :23 _____________________ Listing Object 1: Name :Kane Williams Name :27 _____________________ _____________________________________________Thank You Solution Listing.java import java.util.Scanner; public class Listing { //Declaring instance variables private String name; private int age; //Default constructor
  • 5. public Listing() { name=" "; age=0; } //parameterized Constructor public Listing(String name, int age) { super(); this.name = name; this.age = age; } //Getters and setters public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } //This input() method will take the inputs entered by the user. public void input() { //Scanner Object is used to get the data entered by the user Scanner sc=new Scanner(System.in); //Getting the user name System.out.print("Enter Name :"); setName(sc.nextLine()); //Getting the Age
  • 6. System.out.print("Enter Age :"); setAge(sc.nextInt()); } //This toString() method will displays the constents of the user. @Override public String toString() { System.out.println("Name :"+getName()); System.out.println("Name :"+getAge()); return ""; } } _____________________________________________________________ Driver.java public class Driver { public static void main(String[] args) { //Create an array of 3 Listing Objects Listing listing[]=new Listing[3]; //Creating Listing Objects and populating into an Array for(int i=0;i<3;i++) { listing[i]=new Listing(); System.out.println("Listing Object "+(i+1)+":"); //Calling the input method which capture the data entered by the user listing[i].input(); } //Displaying the Listing objects in the Normal Order System.out.println("Displaying the Listing Objects in the Normal Order ::"); for(int i=0;i<3;i++) { System.out.println("Listing Object "+(i+1)+":"); listing[i].toString();
  • 7. System.out.println("_____________________"); } //Displaying the Listing objects in the Reverse Order System.out.println("Displaying the Listing Objects in the Reverse Order ::"); for(int i=2;i>=0;i--) { System.out.println("Listing Object "+(i+1)+":"); listing[i].toString(); System.out.println("_____________________"); } } } _______________________________________________________ Output: Listing Object 1: Enter Name :Kane Williams Enter Age :27 Listing Object 2: Enter Name :John Mills Enter Age :23 Listing Object 3: Enter Name :Tim Rochey Enter Age :22 Displaying the Listing Objects in the Normal Order :: Listing Object 1: Name :Kane Williams Name :27 _____________________ Listing Object 2: Name :John Mills Name :23 _____________________ Listing Object 3: Name :Tim Rochey
  • 8. Name :22 _____________________ Displaying the Listing Objects in the Reverse Order :: Listing Object 3: Name :Tim Rochey Name :22 _____________________ Listing Object 2: Name :John Mills Name :23 _____________________ Listing Object 1: Name :Kane Williams Name :27 _____________________ _____________________________________________Thank You