ollowing Java program defines an outer cla Studentinfo { ,Dו כ ng name; dentinfo( [1] X I Arguments D = id; name = nm; printStudentinfo() { ystem.out.printin( [2] ); Il print info

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
The following Java program defines an outer class for Studentinfo (ID, Name, Contact) where Contact is an inner class (Phone, Email).
class Studentinfo {
long ID;
String name;
Studentinfo( [1] X
II Arguments
ID = id; name = nm;
}
void printStudentinfo() {
System.out.printin( [2] ): I print info
}
class Contact {
Il inner class starts here
String phone, email;
Contact( [3] X II Arguments
phone = ph; email = eml;
}
public void printContact() {
System.out.printin( [4] ); Il print contact
}
} I/ end of inner class
} Il end of outer class
public class InnerTestApp{
public static void main( [5] ) { I Arguments
II Create new object obj of the Studentinfo class using values 111, "Ahmed"
[6]
II Create new object in of the inner class Contact using values "0561234567", "Ahmed@abc.com"
[7]
II Call printStudentinfo () method on outer object
[8]
II Call printContact () method on inner object
[9]
} llend of main
} llend of app class
Transcribed Image Text:The following Java program defines an outer class for Studentinfo (ID, Name, Contact) where Contact is an inner class (Phone, Email). class Studentinfo { long ID; String name; Studentinfo( [1] X II Arguments ID = id; name = nm; } void printStudentinfo() { System.out.printin( [2] ): I print info } class Contact { Il inner class starts here String phone, email; Contact( [3] X II Arguments phone = ph; email = eml; } public void printContact() { System.out.printin( [4] ); Il print contact } } I/ end of inner class } Il end of outer class public class InnerTestApp{ public static void main( [5] ) { I Arguments II Create new object obj of the Studentinfo class using values 111, "Ahmed" [6] II Create new object in of the inner class Contact using values "0561234567", "Ahmed@abc.com" [7] II Call printStudentinfo () method on outer object [8] II Call printContact () method on inner object [9] } llend of main } llend of app class
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education