|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
Problem with Inner classes Hello, I exercise very easy to achieve, create two different classes, compile and test the program. Until the whole works, then I do one of two class an inner class of another and get the same result. That is what I have been trying to do, but I have no correct method and my every try is unsuccessfully compiled. So, any help on this will be appreciated. |
#2
| |||
| |||
Re: Problem with Inner classes Hello, I think you can try the following Code: BasicArray a =new BasicArray(); |
#3
| |||
| |||
Re: Problem with Inner classes Hello, You must declare your class as static , this will be good for your code Here is the syntax for it Code: Public static class example { |
#4
| |||
| |||
Re: Problem with Inner classes Hello, I think you can do this in your program. Code: A = fac new fac(thisArray[i]); |
#5
| |||
| |||
Re: Problem with Inner classes Hello, Yes thank you, I had put the class static. I have difficulty in understanding the principle of static class. I think the problem is quite solved now, but the static keyword is really giving me a issue in understanding the things. If you can explain me the static keyword with an example then it would be great. Thanks in advance. |
#6
| |||
| |||
Re: Problem with Inner classes Hello, Some information on the static keyword, here is a sample code Code: class mutl { . . . public static double mean(int[] x) { int s = 0; // s of all the elements for (int i=0; i<x.length; i++) { s += x[i]; } return ((double)s) / x.length; }//endmethod mean . . . } |
![]() |
|
Tags: class, constructors, functions, inner class, methods, parameters |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
What are an Autoloading Classes in PHP? | Flaco | Software Development | 5 | 06-03-2010 06:49 AM |
Communication between two classes | ANSEL | Software Development | 4 | 04-12-2009 06:43 PM |
Sealed Classes in C# | Reegan | Software Development | 5 | 27-11-2009 09:16 AM |
C # using classes in C + + | klite | Software Development | 3 | 01-10-2009 10:15 AM |
Classes in VB.NET | Samir_1 | Software Development | 2 | 10-04-2009 12:07 AM |