Is not an enclosing class Java

ZShape is not static so it requires an instance of the outer class. The simplest solution is to make ZShape and any nested class static if you can. I would also make any fields final or static final that you can as well.

align text center with android

Set also android:gravity parameter in TextView to center. For testing the effects of different layout parameters I recommend to use different background color for every element, so you can see how your layout changes with parameters like gravity, layout_gravity or others.

TreeMap sort by value

You can’t have the TreeMap itself sort on the values, since that defies the SortedMap specification: A Map that further provides a total ordering on its keys. However, using an external collection, you can always sort Map.entrySet() however you wish, either by keys, values, or even a combination(!!) of the two. Here’s a generic method … Read more

Double cannot be dereferenced?

EDIT 4/23/12 double cannot be dereferenced is the error some Java compilers give when you try to call a method on a primitive. It seems to me double has no such method would be more helpful, but what do I know. From your code, it seems you think you can copy a text representation of … Read more

“Actual or formal argument lists differs in length”

You try to instantiate an object of the Friends class like this: The class does not have a constructor that takes parameters. You should either add the constructor, or create the object using the constructor that does exist and then use the set-methods. For example, instead of the above:

eclipse won’t start – no java virtual machine was found

Two ways to work around this . Recommended way : In your eclipse.ini file make sure you are pointing -vm to your jdk installation. More on this here. Make sure to add -vm before the -vmargs section. Pass in the vm flag from command line. http://wiki.eclipse.org/FAQ_How_do_I_run_Eclipse%3F#Find_the_JVM Note : Eclipse DOES NOT consult the JAVA_HOME environment … Read more

Downcasting in Java

Downcasting is allowed when there is a possibility that it succeeds at run time: In some cases this will not succeed: When a cast (such as this last one) fails at runtime a ClassCastException will be thrown. In other cases it will work: Note that some casts will be disallowed at compile time, because they … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)