|
| |||||||||
| Tags: class, constructors, functions, inner class, methods, parameters |
![]() |
| | 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.
__________________ www.techarena.in |
|
#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.
__________________ www.techarena.in |
|
#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
. . .
} |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Problem with Inner classes" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to create the Classes in the C++ | Garrick | Software Development | 5 | 02-03-2010 07:09 PM |
| Use of abstract classes | ScarFace 01 | Software Development | 5 | 25-01-2010 09:07 AM |
| Communication between two classes | ANSEL | Software Development | 4 | 04-12-2009 06:43 PM |
| C # using classes in C + + | klite | Software Development | 3 | 01-10-2009 11:15 AM |
| Classes in VB.NET | Samir_1 | Software Development | 2 | 10-04-2009 01:07 AM |