Question
What is static member class

Answers

A static member class behaves much like an ordinary top-level class, except that it can access the static members of the class that contains it. The static nested class can be accessed as the other static members of the enclosing class without having an instance of the outer class. The static class can contain non-static and static members and methods.

public class InnerClass
{
static class StaticInner
{
static int i = 9;
int no = 6;
private void method() {}
public void method1() {}
static void method2() {}
final void method3() {}
}
}

The static inner class can be accessed from Outer Class in the following manner:

InnerClass.StaticInner staticObj= new InnerClass. StaticInner ();

No outer class instance is required to instantiate the nested static class because the static class is a static member of the enclosing class.   Your Comment




More Software,Java Questions..
What is the inputsplit in map reduce software?

Can variables be used in Java without initialization?

What is the difference between java bean and enterprise java bean?

What is software configuration management?

How does the java database connectivity (jdbc) work?

What are the advantages of threads in java?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

What is object cloning in Java?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?



Search
Can you Answer!!
  • Q Against which country did Rahul Dravid score his first ODI Century?
  • Q Who is the first winner of Jnanpith Award in Kannada literature?
  • Q Write macro programming for treeview listing in excel
  • Q What is the use of secondary methods in an activity?
  • Q If you define a user defined data type by using the class keyword, is it a value type or reference type?
  • Q What is 'good code'?
  • Q What are IRQ's for system devices
  • Q Name some types in sapui5?
  • Q What is entry point method of VB.NET program
  • Q Elucidate Guru’s view of Yoga philosophy .
  • Q What is the history of your place?