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
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
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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fbe753e04-cf06-402b-907a-7f86af965e3a%2F2ed13379-9096-4b14-8c63-a3cf83707c3c%2Fy4tq4gp_processed.png&w=3840&q=75)
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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 1 images

Knowledge Booster
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.Recommended textbooks for you

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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education