How to invoke the InnerClass method?

Hi,
could you please tell how to invoke the method of innerclass in the below example?
public class OuterClass {
final String s = "I am outer class member variable";
public void Method() {
String s1 = "I am inner class variable";
class InnerClass {
public void innerMethod() {
int xyz = 20;
System.out.println(s);
System.out.println("Integer value is" + xyz);
System.out.println(s1); // Illegal, compiler error
public static void main(String args[])
      OuterClass2 outer = new OuterClass2();
      outer.outerMethod();
//      outer.Method().InnerClass inner = new InnerClass(); :-( :-(
//      out.innerMethod(); :-( :-(
}

Pannar wrote:
kajbj wrote:
As I said. InnerClass.innerMethod can't be invoked from main. It can only be invoked from within outerMethod.
KajThats what i wanted. plz specify the line of code which descibes invoking innerMethod() from outerMethod. i wanted to see that line of code. :-)
public class OuterClass2 {
    private String s = "I am outer class member variable";
    public void outerMethod() {
        final String s1 = "I am inner class variable";
        class InnerClass {
            public void innerMethod() {
                int xyz = 20;
                System.out.println(s);
                System.out.println("Integer value is" + xyz);
                System.out.println(s1);
        new InnerClass().innerMethod();
    public static void main(String args[]) {
        OuterClass2 outer = new OuterClass2();
        outer.outerMethod();
}

Similar Messages

  • When a context node use non-singleton, how to invoke the supply funtion eve

    when a context node use non-singleton, how to invoke the supply funtion everytime the lead selection is changed ?

    Hi wei,
    <b>Non-singleton nodes:</b>
    Web Dynpro allows you to define non-singleton nodes. Each non-singleton node has one node instance for each node element of the parent collection at runtime. The advantage is that each instance can be accessed directly. When using non-singleton nodes, the nodes are only created when the node values are retrieved. This can save resources that otherwise would slow down the performance of the application.
    <b>Supply function:</b>
    The Web Dynpro tools also automatically enhance the corresponding controller class with a supply function including the user coding area contained in it
    Supply functions are implemented as methods of type
    <b>public void supplyChildNodeElements(SomeChildNode node,
                                        SomeParentNodeElement)</b>
    in a Web Dynpro controller (view controller or custom controller). Supply functions and context nodes have a 1..1 relationship, that is, supply functions are specific for individual context nodes. Under certain conditions, supply functions are called by pages in the Web Dynpro runtime environment.
    Hope this helps u,
    Regards,
    Nagarajan.

  • How to invoke the Cash Drawer to be open by java code.

    hi friends,
    how to invoke the Cash Drawer and display pole to be open by java code.
    pls help me out.

    hello,
    you need to dig out that in the cash drawer APIs there must be some method responsible for opening the cash drawer
    that will supply the operational voltage signal internally to the cash drawer.
    your task is to use the API os the cash drawer and supply the arguments in.
    and will you please tell us what communincation mode you are using like com port or usb.

  • .How to instantiate the innerclass from another class with coded eg.

    How to instantiate the innerclass from another class(both for static & non static) please give me an eg with coding.

    It's just a preference, but I like writing factory methods:
    public class Outer {
        public class Inner {}
        public static class StaticInner {}
        public Inner innerInstance() {
            return new Inner();
        public static StaticInner staticInnerInstance() {
            return new StaticInner();
        public static void main(String[] args) {
            Outer.StaticInner si = Outer.staticInnerInstance();
            Outer outer = new Outer();
            Outer.Inner i = outer.innerInstance();
    }Often, for me, the inner class implements an interface, and the factory method
    lets you hide the implementation class:
    public class Outer {
        private class Inner implements Runnable {
            public void run() {}
        public Runnable runnerInstance() {
            return new Inner();
        public static void main(String[] args) {
            Outer outer = new Outer();
            Runnable r = outer.runnerInstance();
    }

  • How to use the index method for pathpoints object in illustrator through javascripts

    hii...
    am using Illustrator CS2 using javascripts...
    how to use the index method for pathpoints object in illustrator through javascripts..

    Hi, what are you trying to do with path points?
    CarlosCanto

  • How to use the POST method In Oracle APEX 3.1

    Hi,
    In APEX if we are submitting the page the parameters( Variables ) will pass through URL.
    How to hide the these parameters from URL??
    I Hope POST method will solve this problem.
    How to use the POST method in APEX???
    Help me out to solve this problem.
    thanks in advance.
    Cheers,
    Shan

    In APEX if we are submitting the page the parameters( Variables ) will pass through URL.No they won't. Submission POSTs the <tt>wwv_flow</tt> form.
    Sometimes a branch may be performed after submission, generating a URL in which parameter values are visible. To avoid this, use the save state before branching option.
    Other actions&mdash;like using navigation lists, or clicking a link in a report&mdash;will perform a GET using parameters in the URL. In these cases using Session State Protection is advised.

  • How to know the class method behind an enterprise service

    Hi,
    SAP has provided enterprise services for Room booking in Real Estate module. They are even shipping the complete application for a nominal price. But the standard version is not suitable for our client requirement so they want to develop this application inhouse.
    Now my question is:  I know the enterprise services used in this application. How to know the implementing methods behind these enterprise services ?
    If possible suggest which approach will be a better option for the inhouse development.
    1. Webdynpro ABAP and use directly methods behind the enterprise services.
    2. Webdynpro ABAP and create client proxy class for the enterprise services.
    3. Webdynpro JAVA and use the enterprise services.
    4. Using visual composer modelling the application.
    Please suggest the best alternative.
    Best Regards,
    Aleem Mohiuddin.

    Hi
    They are even shipping the complete application for a nominal price. But the standard version is not suitable for our client requirement so they want to develop this application inhouse.
    I assume you are talking about xApps.
    How to know the implementing methods behind these enterprise services ?
    In sproxy transaction you can search service and then you can see class and method implemented behind that particular service.
    1. Webdynpro ABAP and use directly methods behind the enterprise services.
    In my opinion not recommended to bypass ES and use method behind it.
    2. Webdynpro ABAP and create client proxy class for the enterprise services.
    Not sure why you want to create proxy of ES.
    3. Webdynpro JAVA and use the enterprise services.
    4. Using visual composer modelling the application.
    You can use either Webdynpro (ABAP or Java) or VC to model your application which consume ES in backend. Both options are good, you can chose Java or ABAP flavor of dynpro based on skill available in team. VC is very effective in rapid modelling and can be used in protyping or in development of complete application.
    Regards,
    Gourav

  • How to invoke the FTP rename operation?

    Does anybody know whether it is possible and how to invoke the 'rename' operation from the FTP Adapter (using ESB)?
    Thanks in advance,
    Jeroen van Schaijk

    Hi,
    Please use the below code for your Web Service Call
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:cus="urn:crmondemand/ws/odesabs/customrecordtype/" xmlns:data="urn:/crmondemand/xml/customrecordtype/data">
    <SOAP-ENV:Header>
              <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext">
                   <wsse:UsernameToken>
                        <wsse:Username> USERNAME </wsse:Username>
                        <wsse:Password> PASSWORD </wsse:Password>
                   </wsse:UsernameToken>
              </wsse:Security>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
    <cus:CustomRecordTypeUpsert_Input>
    <data:CustomRecordType>
    <!--You may enter the following 6 items in any order-->
    <data:Name>myname</data:Name>
    <!--Optional:-->
    <data:SingularName>myname</data:SingularName>
    <!--Optional:-->
    <data:PluralName>myname</data:PluralName>
    <!--Optional:-->
    <data:ShortName>myname</data:ShortName>
    <!--Optional:-->
    <data:IconName>myname</data:IconName>
    <data:ListOfCustomRecordTypeTranslations>
    <!--1 or more repetitions:-->
    <data:CustomRecordTypeTranslation>
    <!--You may enter the following 4 items in any order-->
    <data:LanguageCode>?</data:LanguageCode>
    <data:SingularName>?</data:SingularName>
    <data:PluralName>?</data:PluralName>
    <data:ShortName>?</data:ShortName>
    </data:CustomRecordTypeTranslation>
    </data:ListOfCustomRecordTypeTranslations>
    </data:CustomRecordType>
    </cus:CustomRecordTypeUpsert_Input>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    Hope that helps!
    Thanks & Regards
    Sablok Kumar

  • How to invoke the sql lodaer?

    hi,
    i have installed oracle 10g and the loader should have been installed by default as i have been told. Can you tell me how to invoke the loader?. I tried sqlldr in the sql> prompt but receive a "command not known" error.
    thx

    Hi,
    If you set ORACLE_HOME enviroment variables, then just typing command sqlldr should work.
    http://www.oracle.com/technology/software/products/database/xe/files/install.102/b25144/toc.htm#BABDGCHH
    Br, Jari

  • QM Module - How to get the Inspection Method & Characteristic value(Urgent)

    Hi All,
        I have inspection lot number (PRUEFLOS), batch number 
       (CHARGE), plant (WERK) & material number
       (MATNR) , using these fields how to get the inspection
       method (PMETHODE) & Characteristic Value (ATWRT) ?
       I don’t know the relation among them.
    Could you please help?
    Thanks in advance.
    Saket

    Hi Jose,
    Thanks for your help, could you please look into my requirement.
    For all inspection characteristics listed in the selected COA profile, I have to retrieve the Inspection Method for all listed inspection characteristics. And also I have to retrieve the characteristic value(uncertainty). Additionally, for inspection characteristics that are quantitative, being checked, the characteristic value(uncertainty) from that Inspection method will be retrieved from class 3050_UNCERTAINTY, class type 006, characteristic, P2150_UNCERTAINTY. 
    Please help me out.
    Thanks,
    Saket .

  • How to invoke the softKeyboard for a TLF textfield in AS3?

    Hi,
    I need to use a TLF textfield in a Flash mobile app.
    How to invoke the softKeyboard on mobile devices for such a TLF textfield? I tried it the way below, but it's not showing up:
    import flash.ui.Keyboard;
    import flash.events.KeyboardEvent;
    import flash.events.SoftKeyboardEvent;
    chat.needsSoftKeyboard = true
    chat.requestSoftKeyboard()
    (I can't use a "classic textfield" for a couple of reasons)
    Any tips welcome

    If you had something like this :
    <FORM name="checkform">
    <input type="text" name="myText" size="5">
    <select size="1" name="select" onChange="check()">
    <option value="1">Number1
    <option value="2" selected>Number2
    </select>
    </FORM>Your javascript funtion would look like this :
    <script language="JavaScript">
    function check() {
         if (this.checkform.select.options[this.checkform.select.selectedIndex].value == "1") {
              this.checkform.myText.size = "20"
         } else {
              this.checkform.myText.size = "5"
    </script>Note the names of the form (checkform) and the input field (myText).

  • Invoking the main() method of a class within another

    Greetings -
    Can someone tell me what happens when you invoke the main() method of a class from within another class?
    I have a third-party class, designed to be invoked from a command line, that I want to invoke from within a separate class. What appears to be happening is that following the successful execution of the third-party class, the invoking class is terminated as well. That's not the intended behavior I had envisioned. ^_^
    Is there a better way than invoking the main() method? I still need the invoking class to continue executing.
    Thanks!

    Navigate yourself around pitfalls related to the Runtime.exec() method

  • How to invoke the OAM from Linux

    Hey apps gurs
    any one can tell me,how to invoke the OAM

    OAM is not an .exe but a webpage
    So, you must have an url to startup OAM

  • How to invoke the app by touching the screen (without using the home button)

    Kindly  provide the solutions for the following issues
    1.       How to invoke the app by touching the screen (without using the home button)
    2.       Estimated lifespan running an iPad3 continuously 24x7
    awaiting for your valuable response.
    Thanks and regards,
    Sathya.

    1.  You can only invoke an app by touching its icon.
    2.  All depends on what your app does.

  • Could not invoke the service() method when the JSP page is loaded

    I am new to servlets/jsp so excuse if I am doing something silly here:
    I have a JSP page the suppose to be loading a session attrbute from a simple servlet. When I go to load the jsp page, I get Could not invoke the service() method.
    Any help is much appreciated:
    Here is my JSP:
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
         pageEncoding="ISO-8859-1"%>
    <%@ page session="true" import="insurance.PolicyObj,java.util.*"%>
    <% Vector VTable = (Vector) session.getAttribute("policyTable"); %>
    <HTML>
    <BODY>
    <Form name=listTable action="InsSer" method="post">
    <TABLE border="1">
         <TBODY>
              <TR>
                   <TD width="258" align="center"><B>Policy Id</B></TD>
                   <TD width="187" align="center"><B>Customer Name</B></TD>
                   <TD width="160" align="center"><B>Agent Name</B></TD>
                   <TD width="134" align="center"><B>Status</B></TD>
              </TR>
              <TR>
    <%
    for (int index=0; index < VTable.size();index++) {
    PolicyObj TableL = (PolicyObj) VTable.elementAt(index);
    %>
         <TR bgcolor="#99CCFF">
    <TD width="258" align="center"> <%= TableL.getPolicyId()%> </TD>
    <TD width="187" align="center"> <%= TableL.getCustomerName()%> </TD>
    <TD width="187" align="center"> <%= TableL.getAgentName() %> </TD>
    <TD width="187" align="center"> <%= TableL.getPolicyStatus() %></TD>
    </TR>
         <% } %>
         </TBODY>
    </TABLE>
    <P><INPUT type="submit" name="Submit" value="Refresh Active Policies"></P>
    </BODY>
    </HTML>
    Here is my servlet:
    package insurance;
    import java.io.IOException;
    import java.util.Vector;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.Servlet;
    import javax.servlet.ServletContext;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    public class InsSer extends HttpServlet implements Servlet {
         /* (non-Java-doc)
         * @see javax.servlet.http.HttpServlet#HttpServlet()
         public InsSer() {
              super();
         /* (non-Java-doc)
         * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest arg0, HttpServletResponse resp)
         protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
              doPost(req,resp);
              // TODO Auto-generated method stub
         /* (non-Java-doc)
         * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest arg0, HttpServletResponse resp)
         protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
              //PolicyObj[] policyTable = new PolicyObj[3];
              HttpSession session = req.getSession(false);
              //if (session == null) {
                   //resp.sendRedirect("http://localhost:9080/Insurance/error.html");
              //Vector buylist = (Vector) session.getAttribute("PolicyList");
              Vector policyList = null;
              policyList.addElement(new PolicyObj());
              ((PolicyObj) policyList.get(0)).setPolicyId("0009800002");
              ((PolicyObj) policyList.get(0)).setCustomerName("Salim Zeitouni");
              ((PolicyObj) policyList.get(0)).setAgentName("Jack Smith");
              ((PolicyObj) policyList.get(0)).setPolicyStatus("Pending");
              session.setAttribute("policyTable",policyList);
              ServletContext sc = getServletContext();
              RequestDispatcher rd = sc.getRequestDispatcher("InsSev1.jsp");
              rd.forward(req,resp);
    Message was edited by:
    sfz1
    Message was edited by:
    sfz1

    I am new to servlets/jsp so excuse if I am doing something silly here:
    I have a JSP page the suppose to be loading a session attrbute from a simple servlet. When I go to load the jsp page, I get Could not invoke the service() method.
    Any help is much appreciated:
    Here is my JSP:
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
         pageEncoding="ISO-8859-1"%>
    <%@ page session="true" import="insurance.PolicyObj,java.util.*"%>
    <% Vector VTable = (Vector) session.getAttribute("policyTable"); %>
    <HTML>
    <BODY>
    <Form name=listTable action="InsSer" method="post">
    <TABLE border="1">
         <TBODY>
              <TR>
                   <TD width="258" align="center"><B>Policy Id</B></TD>
                   <TD width="187" align="center"><B>Customer Name</B></TD>
                   <TD width="160" align="center"><B>Agent Name</B></TD>
                   <TD width="134" align="center"><B>Status</B></TD>
              </TR>
              <TR>
    <%
    for (int index=0; index < VTable.size();index++) {
    PolicyObj TableL = (PolicyObj) VTable.elementAt(index);
    %>
         <TR bgcolor="#99CCFF">
    <TD width="258" align="center"> <%= TableL.getPolicyId()%> </TD>
    <TD width="187" align="center"> <%= TableL.getCustomerName()%> </TD>
    <TD width="187" align="center"> <%= TableL.getAgentName() %> </TD>
    <TD width="187" align="center"> <%= TableL.getPolicyStatus() %></TD>
    </TR>
         <% } %>
         </TBODY>
    </TABLE>
    <P><INPUT type="submit" name="Submit" value="Refresh Active Policies"></P>
    </BODY>
    </HTML>
    Here is my servlet:
    package insurance;
    import java.io.IOException;
    import java.util.Vector;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.Servlet;
    import javax.servlet.ServletContext;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    public class InsSer extends HttpServlet implements Servlet {
         /* (non-Java-doc)
         * @see javax.servlet.http.HttpServlet#HttpServlet()
         public InsSer() {
              super();
         /* (non-Java-doc)
         * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest arg0, HttpServletResponse resp)
         protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
              doPost(req,resp);
              // TODO Auto-generated method stub
         /* (non-Java-doc)
         * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest arg0, HttpServletResponse resp)
         protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
              //PolicyObj[] policyTable = new PolicyObj[3];
              HttpSession session = req.getSession(false);
              //if (session == null) {
                   //resp.sendRedirect("http://localhost:9080/Insurance/error.html");
              //Vector buylist = (Vector) session.getAttribute("PolicyList");
              Vector policyList = null;
              policyList.addElement(new PolicyObj());
              ((PolicyObj) policyList.get(0)).setPolicyId("0009800002");
              ((PolicyObj) policyList.get(0)).setCustomerName("Salim Zeitouni");
              ((PolicyObj) policyList.get(0)).setAgentName("Jack Smith");
              ((PolicyObj) policyList.get(0)).setPolicyStatus("Pending");
              session.setAttribute("policyTable",policyList);
              ServletContext sc = getServletContext();
              RequestDispatcher rd = sc.getRequestDispatcher("InsSev1.jsp");
              rd.forward(req,resp);
    Message was edited by:
    sfz1
    Message was edited by:
    sfz1

Maybe you are looking for

  • Airport card is no longer reconised

    hi the guys and girls, basically i have have my laptop for more than 3 years now and it has worked seamlessly up until the last 6 months and just recently it has decided to not reconise the inbuilt Airport extreme card that was inbuilt at purchase (s

  • G50-70 line in middle of LCD

    Hi,I have Lenovo laptop G50-70 and I have a problem that there is sometime one or more line in middle of the LCD and its removed by pressing screen from the bottom lightly. My question is that what component is needed to be changed in the LCD so this

  • Drop down in screen painter

    i would like to have a drop down in screen painter. i declared in screen painter as listbox - also i namned function code lstbx now i have to variants: first is just taking the name of the domain and giving all values to it. the problem is in fronten

  • The jstl use error in the weblogic!!

    I am attempting to deploy the example petstore in the weblogic8.1.7,but I found a error :when the server handle sidebar.jsp, a exception occurs: can not find the property "local" setter method. I am very attonished in this exception, but there is no

  • Can I still install iCloud if I have Windoes XP?

    Can I stii install iCloud if I have Windows XP?