Thursday, October 8, 2009

Tips & Tricks

How to open Blocked websites at Your workplace

If you are not able to visit your favorite websites in your school or college or any place where some sites are blocked?

You can use the following proxy sites to open those blocked websites.

Below are the list of various sites from which you can surf the blocked websites !


Monday, September 21, 2009

Java Object Reference Variables

Reference Variable Assignments

Car myRide = new Car();

Makes a reference variable myRide of type Car.
Creates a new Car object on the heap
Assigns the newly created Car object to the reference variable myRide.


Assigning One Object Reference to Another


Object reference variables work exactly like the primitive data types. The contents of a reference variable are a bit pattern, which when assigned to another object reference, it is copied to that reference.

import java.awt.Dimension;

public class ReferenceTest {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Dimension a = new Dimension(5, 10);
System.out.println(" a.height =" + a.height);
Dimension b = a;
b.height = 30;
System.out.println(" a.height =" + a.height + " after change to b ");
System.out.println(" b.height =" + b.height + " after change to b ");
}
}

a.height = 10

a.height = 30 after change to b

Both the variables, refer to the same instance of the Dimension object.



One exception to the way object references are assigned is String. In Java, String objects are given special treatment. String objects are immutable, you can't change the value of a String object.

class StringTest {

public static void main(String[] args) {

String x = "Java"; // Assign a value to x

String y = x; // Now y and x refer to the same String object

System.out.println("y string = " + y);

x = x + " Bean "; // Now modify the object using the x reference

System.out.println("y string = " + y);

}

}



y string = Java

y string = Java

Java Object Reference Variables

How Big Is a Reference Variable?

You don't know.Only the people who involved in the development of Java JVM knows it.But, all the references for a given JVM will be of same in size regardless of the objects they reference, but each JVM might have a different way of representing references, so references on one JVM may be smaller or larger than references on other JVM. So, the size of the object references are the same size, regardless of the size of the actual objects that they refers to. But java not permitting us to know complete details like size of the Object reference variables. These variables acts as a pointers to point to the objects. And Java wont allow us to perform arithmetic or any other type of operations on object variables.

An object reference variable holds bits that represents the way to access a particular object. It doesnt hold the complete object, but it holds something like a pointer.And an object reference variable represents only one object....


What will be the initial value of an object reference which is defined as an instance variable?



The object references are all initialized to null in Java. However in order to do anything useful with these references, you must set them to a valid object, else you will get NullPointerExceptions everywhere you try to use such default initialized references.

Wednesday, September 16, 2009

Solutions for Wamp Server Problems

The most common problem everyone faces with WAMP Server is
"Aestan Tray Menu ————————— Could not execute menu item (internal error) [Exception] Could not perform service action: The service has not been started".

Here i am giving different solutions to get rid of this problem.


The configuration file contains a syntax error on line 3:
eparseeoor could not load the file “images_on.bmp”
could-not-execute-menu-item-wampserver-error

By default , the wamp server will takes 8080 as its working port.
You can change that port number as you like..
here are the steps to do that ……..
  1. click on wamp server tray icon
  2. then, click on apache->then select http.conf->
  3. here one notepad will opens…
  4. scroll down there you will see the port number that Wamp server takes…
  5. simply chnage that port number to
  6. #Listen 0.0.0.0:9080
  7. Listen 9080
now……… save that file and restart the services…it will works fine……….
please post your comments here……. ask for any doubts..so that it will help others
one more thing to do;

Second Method:
  • Uncheck IIS server from control panel->add or remove program-> add or remove windows components-> uncheck iis service.

Third Method:

If still problem exists, better use the XAMPP server insted of WAMP server. Because XAMPP server also works just like as WAMP server , there is no difference in the functionality. Now such problems will erases like in WAMP.
 

Onion Labs © 2008 ---- Sakshieducation, Onion Labs.