Search This Blog

Tuesday, September 9, 2014

The Power of Imagination

Imagination is the ability to form a mental image of something that is not perceived through the five senses. It is the ability of the mind to build mental scenes, objects or events that do not exist, are not present, or have happened in the past.
Everyone possesses a certain of imagination ability. In some, it is highly developed, and in others, it manifests in a weaker form. Imagination manifests in various degrees in various people.
Imagination makes it possible to experience a whole world inside the mind. It gives the ability to look at any situation from a different point of view, and to mentally explore the past and the future.
This ability manifests in various forms, one of which is daydreaming. Though too much idle daydreaming may make one impractical, a certain degree daydreaming, while not being engaged in something that requires attention, provides temporary happiness, calmness and relief from stress.
In your imagination, you can travel anywhere in the speed of light, without any obstacles. It can make you feel free, though temporarily, and only in the mind, from tasks, difficulties and unpleasant circumstances.
Imagination is not limited only to seeing pictures in the mind. It includes all the five senses and the feelings. One can imagine a sound, taste, smell, a physical sensation or a feeling or emotion. For some people it is easier to see mental pictures, others find it easier to imagine a feeling, and some are more comfortable imagining the sensation of one of the five senses. Training of the imagination gives the ability to combine all the senses.
A developed and strong imagination does not make you a daydreamer and impractical. On the contrary, it strengthens your creative abilities, and is a great tool for recreating and remodeling your world and life.
This is a great power that can change your whole life. It is used extensively in magick, creative visualization and affirmations. It is the creator of circumstances and events. When you know how to work with it, you can make your hearts' desires come true.
Imagination has a great role and value in each one's life. It is much more than just idle daydreaming. We all use it, whether consciously or unconsciously, in most of our daily affairs. We use our imagination whenever we plan a party, a trip, our work or a meeting. We use it when we describe an event, explain how to arrive to a certain street, write, tell a story or cook a cake.
Imagination is a creative power that is necessary for inventing an instrument, designing a dress or a house, painting a picture or writing a book. The creative power of imagination has an important role in the achievement of success in any field. What we imagine with faith and feelings comes into being. It is the important ingredient of creative visualization, positive thinking and affirmations.
Visualizing an object or a situation, and repeating often this mental image, attracts the object or situation we voisualize into our lives. This opens for us new, vast and fascinating opportunities.
This means that we should think only in a positive manner about our desires, otherwise, we might attract into our lives events, situations and people that we don't really want. This is actually what most of us do, because we don't use the power of imagination correctly.
If you do not recognize the importance of the power of the imagination, and let it run riot, your life may not be as happy and successful as you would have wanted it to be.
Lack of understanding of the power of the imagination is responsible for the suffering, incompetence, difficulties, failures and unhappiness people experience. For some reason, most people are inclined to think in a negative way. They do not expect success. They expect the worst, and when they fail, they believe that fate is against them. This attitude can be changed, and then life will improve accordingly.
Understanding, how to use your imagination correctly, and putting this knowledge into practice, for your own and others' benefit, will put you on the golden path to success, satisfaction and happiness.

Java static class Example

In this example, we will discuss about static classes in Java. First of all, let’s give a short explanation of the static modifier. For example, if a field or a method in a class has the static modifier in its declaration , then it is always associated with the class as a whole, rather than with any object of the class.
In the code below we have declared a class named Vehicle, a class field member named vehicleType and a method namedgetVehicleType(), both declared as static.


1public class Vehicle {
2
3    private static String vehicleType;
4     
5    public static String getVehicleType(){
6        return vehicleType;
7    }
8
9}
The static modifier allows us to access the variable vehicleType and the method getVehicleType() using the class name itself, as follows:
Vehicle.vehicleType
Vehicle.getVehicleType()
Something similar happens to classes that are declared static, but in order to explain this better, we must first explain the inner classes or generally, the nested classes, because ONLY nested classes can be static.
Java supports the concept of nested classes. Nested classes are classes that can be defined within the body of another class. An example of a nested class is illustrated below:
1class OuterClass {
2    //code
3    class NestedClass {
4        //code
5    }
6}
The OuterClass which contains another class can be also called top-level class.
Nested classes are further divided into two categories: static and non-static. Nested classes that are declared static are called static nested classes. Non-static nested classes are just called inner classes.
1class OuterClass {
2    //code
3    static class StaticNestedClass {
4        //code
5    }
6    class InnerClass {
7        //code
8    }
9}
  • What’s the difference between nested static classes and non-static (inner) classes?
  • The main difference is that inner class requires instantiation of the outer class so as to be initialized and it is always associated with an instance of the enclosing class. On the other hand nested static class is not associated with any instance of the enclosing class. Nested static classes are declared with the static keyword, which means than can be accessed like any other static member of class, as we shown before.

1. Example of nested classes

Create a java class named OuterClass.java with the following code:
OuterClass.java
01package com.javacodegeeks.javabasics.staticclass;
02
03public class OuterClass {
04
05    public static void main(String[] args) {
06
07        //nested static class doesn't need instantiation of the outer class
08        OuterClass.NestedStaticClass nestedStatic = new OuterClass.NestedStaticClass();
09        nestedStatic.printMethodNestedStatic();
10
11        //inner class needs instantiation of the outer class
12        OuterClass outer = new OuterClass();
13        OuterClass.InnerClass inner = outer.new InnerClass();
14        inner.printMethodInner();
15    }
16
17    // Static nested class
18    public static class NestedStaticClass {
19
20        public void printMethodNestedStatic() {
21            System.out.println("Method of nested static class");
22        }
23    }
24
25    // inner (non-static nested) class
26    public class InnerClass {
27
28        public void printMethodInner() {
29            System.out.println("Method of inner(non-static nested) class");
30        }
31    }
32
33}
As we can observe in the above code, we have declared a class named OuterClass which is considered to be the outer class or otherwise, the top level class. Also, we can see that we have declared two more nested classes (they are enclosed in the outer class), one of which is static and the other one is non-static. Finally, we have declared a main method in the outer class, which is static as always (Really, why is that? The answer is that we can call it without creating any instance of class which contains this main method). We can see that the method of the nested static class can be accessed without creating an object of the OuterClass, whereas the method of the inner class needs instantiation of the OuterClass in order to get accessed.

  • Output:
Method of nested static class
Method of inner(non-static nested) class

My Profile

My photo
can be reached at 09916017317