SlideShare une entreprise Scribd logo
1  sur  22
Static Members
 The ‘static’ keyword in java is mainly
used for memory management.
 ‘static’ is applied to variables, methods,
blocks and nested classes.
 The variables and methods declared
in the class are referred as instance
members because a new copy of each
of them is created for each object.
 A member that is common to all the
objects and accessed without using a
particular object, those are declared
using static keyword.
Example:
 static int count;
 static int max(int x, int y);
 The members that are declared as
static are referred as static members,
and the static variables, static methods
are also referred as class variables,
and class methods.
‘static’ variables
 If you declare any variable with ‘static’, it is
known as ‘static variable’.
 The ‘static’ variable is used to refer common
properties of all objects(not unique for each
object).
 Ex: Company name of all employees,
College name for all the students.
 It gets memory only once in class area at the
time of class loading.
‘static’ methods
 ‘static’ keyword is used with any
method, is called ‘static method’.
 ‘static method’ belongs to the class
rather than object of a class.
 Methods declared as static have several
restrictions.
 1. They can only call other static methods.
 2. They must only access static data.
 3. They cannot refer to this or super in
any way.
 4. We can access the static member by
using the class name itself.
 Example 1:
//Defining and using static members
class MathOperation
{
static float mul(float x,float y)
{
return x*y;
}
static float divide(float x,float y)
{
return x/y;
}
}
class MathApplication
{
public static void main(String args[])
{
float a=MathOperation.mul(4.0,5.0);
float b=MathOperation.divide(a,2.0);
System.out.println("b="+b);
}
}
Example 2:
class Student
{
int rollno;
String name;
static String college=“VLITS”;
static void change() {
college=“Vignan University”;
}
Student(int r,int n) {
rollno=r;
name=n;
}
void display() {
System.out.println(roll no+” ”+name+” ”+college);
}
}
class StudentsInfomethod
{
public static void main(String args[])
{
Student.change()
Student s1=new Student(501,“Pavan”);
Student s2=new Student(502,“Kalyani”);
Student s3=new Student(503,“Vignesh”);
s1.display();
s2.display();
s3.display();
}
}
Static Block
 A static block is a block of statements declared as
static, something like this:
static
{
Statements;
}
 JVM executes a static block on a highest priority
bases. This means JVM first goes to static block
even before it looks for the main() method in the
program.
Example:
class Test
{
static
{
System.out.println("static block");
}
public static void main(String args[])
{
System.out.println("main block");
}
}
Output:
Static block
main block
Static class
 When we declare a certain member as
static, we do not have to create an
instance of the class to access it.
 Syntax
class Outer
{
static class Nested
{
}
}
 Here we have declared an Outer class
and then declared a nested class.
 Static classes in Java can be created
only as nested classes.
 Inner class- Inner classes are the
classes that are non-static and nested.
 They are written inside an outer class.
 We are unable to create an instance of
the inner class without creating an
instance of its given outer class.
 This is needed when the user has to
create a class but doesn't want other
classes to access it. Here we can use
an inner class for that reason.
Outer class- Outer classes are the
classes in which nested or inner classes
are defined.
Nested class- Nested class can be static
or non-static. The non-static nested
class is known as an inner class.
An instance of a static nested class
can be created without the instance of
the outer class. The static member of the
outer class can be accessed only by the
‘static’ class
 Static class in Java is a nested class and it
doesn't need the reference of the outer
class.
 Static class can access only the static
members of its outer class, cannot access
the non-static members.
 Inner classes can access the static and
the non-static members of the outer class.
class Outer {
// static member of the outer class
private static char grade = 'A';
// Static class
static class Nested {
//non-static method
public void fun() {
// nested class can access the static
members // of the outer class
System.out.println("Grade: " + grade);
}
}
public static void main(String args[]) {
Outer.Nested obj = new Outer.Nested();
//creating an object of nested
// class without creating an object
// of the outer class.
obj.fun();
}
}
Example 2:
class TestOuter1{
static int data=30;
static class Inner{
void msg()
{
System.out.println("data is "+data);}
}
public static void main(String args[])
{
TestOuter1.Inner obj=new TestOuter1.Inner
();
obj.msg();
}
}
Thank you

Contenu connexe

Similaire à Static Members-Java.pptx

9781439035665 ppt ch10
9781439035665 ppt ch109781439035665 ppt ch10
9781439035665 ppt ch10Terry Yoast
 
UNIT-2.pptx CS3391 Inheritance , types, packages and Interfaces
UNIT-2.pptx CS3391 Inheritance , types, packages and InterfacesUNIT-2.pptx CS3391 Inheritance , types, packages and Interfaces
UNIT-2.pptx CS3391 Inheritance , types, packages and InterfacesSakkaravarthiS1
 
Corejava Training in Bangalore Tutorial
Corejava Training in Bangalore TutorialCorejava Training in Bangalore Tutorial
Corejava Training in Bangalore Tutorialrajkamaltibacademy
 
Nested classes in java
Nested classes in javaNested classes in java
Nested classes in javaRicha Singh
 
this keyword in Java.pptx
this keyword in Java.pptxthis keyword in Java.pptx
this keyword in Java.pptxParvizMirzayev2
 
Inner Classes & Multi Threading in JAVA
Inner Classes & Multi Threading in JAVAInner Classes & Multi Threading in JAVA
Inner Classes & Multi Threading in JAVATech_MX
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++rprajat007
 
ch4 foohggggvvbbhhhhhhhhhbbbbbbbbbbbbp.pdf
ch4 foohggggvvbbhhhhhhhhhbbbbbbbbbbbbp.pdfch4 foohggggvvbbhhhhhhhhhbbbbbbbbbbbbp.pdf
ch4 foohggggvvbbhhhhhhhhhbbbbbbbbbbbbp.pdfbca23189c
 
this keyword in Java.pdf
this keyword in Java.pdfthis keyword in Java.pdf
this keyword in Java.pdfParvizMirzayev2
 
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B KuteChapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B KuteTushar B Kute
 
UNIT - IIInew.pptx
UNIT - IIInew.pptxUNIT - IIInew.pptx
UNIT - IIInew.pptxakila m
 
Introduction to java programming
Introduction to java programmingIntroduction to java programming
Introduction to java programmingshinyduela
 
Static keyword ppt
Static keyword pptStatic keyword ppt
Static keyword pptVinod Kumar
 
A1771937735_21789_14_2018__16_ Nested Classes.ppt
A1771937735_21789_14_2018__16_ Nested Classes.pptA1771937735_21789_14_2018__16_ Nested Classes.ppt
A1771937735_21789_14_2018__16_ Nested Classes.pptRithwikRanjan
 
class as the basis.pptx
class as the basis.pptxclass as the basis.pptx
class as the basis.pptxEpsiba1
 

Similaire à Static Members-Java.pptx (20)

9781439035665 ppt ch10
9781439035665 ppt ch109781439035665 ppt ch10
9781439035665 ppt ch10
 
UNIT-2.pptx CS3391 Inheritance , types, packages and Interfaces
UNIT-2.pptx CS3391 Inheritance , types, packages and InterfacesUNIT-2.pptx CS3391 Inheritance , types, packages and Interfaces
UNIT-2.pptx CS3391 Inheritance , types, packages and Interfaces
 
Corejava Training in Bangalore Tutorial
Corejava Training in Bangalore TutorialCorejava Training in Bangalore Tutorial
Corejava Training in Bangalore Tutorial
 
Nested classes in java
Nested classes in javaNested classes in java
Nested classes in java
 
BCA Class and Object (3).pptx
BCA Class and Object (3).pptxBCA Class and Object (3).pptx
BCA Class and Object (3).pptx
 
this keyword in Java.pptx
this keyword in Java.pptxthis keyword in Java.pptx
this keyword in Java.pptx
 
Inner Classes & Multi Threading in JAVA
Inner Classes & Multi Threading in JAVAInner Classes & Multi Threading in JAVA
Inner Classes & Multi Threading in JAVA
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++
 
OOPs & Inheritance Notes
OOPs & Inheritance NotesOOPs & Inheritance Notes
OOPs & Inheritance Notes
 
ch4 foohggggvvbbhhhhhhhhhbbbbbbbbbbbbp.pdf
ch4 foohggggvvbbhhhhhhhhhbbbbbbbbbbbbp.pdfch4 foohggggvvbbhhhhhhhhhbbbbbbbbbbbbp.pdf
ch4 foohggggvvbbhhhhhhhhhbbbbbbbbbbbbp.pdf
 
this keyword in Java.pdf
this keyword in Java.pdfthis keyword in Java.pdf
this keyword in Java.pdf
 
Nested class
Nested classNested class
Nested class
 
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B KuteChapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
 
Chap11
Chap11Chap11
Chap11
 
UNIT - IIInew.pptx
UNIT - IIInew.pptxUNIT - IIInew.pptx
UNIT - IIInew.pptx
 
Introduction to java programming
Introduction to java programmingIntroduction to java programming
Introduction to java programming
 
Static keyword ppt
Static keyword pptStatic keyword ppt
Static keyword ppt
 
A1771937735_21789_14_2018__16_ Nested Classes.ppt
A1771937735_21789_14_2018__16_ Nested Classes.pptA1771937735_21789_14_2018__16_ Nested Classes.ppt
A1771937735_21789_14_2018__16_ Nested Classes.ppt
 
class as the basis.pptx
class as the basis.pptxclass as the basis.pptx
class as the basis.pptx
 
Java static keyword
Java static keywordJava static keyword
Java static keyword
 

Dernier

Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...software pro Development
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfryanfarris8
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 

Dernier (20)

Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 

Static Members-Java.pptx

  • 2.  The ‘static’ keyword in java is mainly used for memory management.  ‘static’ is applied to variables, methods, blocks and nested classes.
  • 3.  The variables and methods declared in the class are referred as instance members because a new copy of each of them is created for each object.  A member that is common to all the objects and accessed without using a particular object, those are declared using static keyword.
  • 4. Example:  static int count;  static int max(int x, int y);  The members that are declared as static are referred as static members, and the static variables, static methods are also referred as class variables, and class methods.
  • 5. ‘static’ variables  If you declare any variable with ‘static’, it is known as ‘static variable’.  The ‘static’ variable is used to refer common properties of all objects(not unique for each object).  Ex: Company name of all employees, College name for all the students.  It gets memory only once in class area at the time of class loading.
  • 6. ‘static’ methods  ‘static’ keyword is used with any method, is called ‘static method’.  ‘static method’ belongs to the class rather than object of a class.
  • 7.  Methods declared as static have several restrictions.  1. They can only call other static methods.  2. They must only access static data.  3. They cannot refer to this or super in any way.  4. We can access the static member by using the class name itself.
  • 8.  Example 1: //Defining and using static members class MathOperation { static float mul(float x,float y) { return x*y; } static float divide(float x,float y) { return x/y; } }
  • 9. class MathApplication { public static void main(String args[]) { float a=MathOperation.mul(4.0,5.0); float b=MathOperation.divide(a,2.0); System.out.println("b="+b); } }
  • 10. Example 2: class Student { int rollno; String name; static String college=“VLITS”; static void change() { college=“Vignan University”; } Student(int r,int n) { rollno=r; name=n; } void display() { System.out.println(roll no+” ”+name+” ”+college); } }
  • 11. class StudentsInfomethod { public static void main(String args[]) { Student.change() Student s1=new Student(501,“Pavan”); Student s2=new Student(502,“Kalyani”); Student s3=new Student(503,“Vignesh”); s1.display(); s2.display(); s3.display(); } }
  • 12. Static Block  A static block is a block of statements declared as static, something like this: static { Statements; }  JVM executes a static block on a highest priority bases. This means JVM first goes to static block even before it looks for the main() method in the program.
  • 13. Example: class Test { static { System.out.println("static block"); } public static void main(String args[]) { System.out.println("main block"); } } Output: Static block main block
  • 14. Static class  When we declare a certain member as static, we do not have to create an instance of the class to access it.  Syntax class Outer { static class Nested { } }  Here we have declared an Outer class and then declared a nested class.
  • 15.  Static classes in Java can be created only as nested classes.  Inner class- Inner classes are the classes that are non-static and nested.  They are written inside an outer class.  We are unable to create an instance of the inner class without creating an instance of its given outer class.  This is needed when the user has to create a class but doesn't want other classes to access it. Here we can use an inner class for that reason.
  • 16. Outer class- Outer classes are the classes in which nested or inner classes are defined. Nested class- Nested class can be static or non-static. The non-static nested class is known as an inner class. An instance of a static nested class can be created without the instance of the outer class. The static member of the outer class can be accessed only by the
  • 17. ‘static’ class  Static class in Java is a nested class and it doesn't need the reference of the outer class.  Static class can access only the static members of its outer class, cannot access the non-static members.  Inner classes can access the static and the non-static members of the outer class.
  • 18.
  • 19. class Outer { // static member of the outer class private static char grade = 'A'; // Static class static class Nested { //non-static method public void fun() { // nested class can access the static members // of the outer class System.out.println("Grade: " + grade); } }
  • 20. public static void main(String args[]) { Outer.Nested obj = new Outer.Nested(); //creating an object of nested // class without creating an object // of the outer class. obj.fun(); } }
  • 21. Example 2: class TestOuter1{ static int data=30; static class Inner{ void msg() { System.out.println("data is "+data);} } public static void main(String args[]) { TestOuter1.Inner obj=new TestOuter1.Inner (); obj.msg(); } }