Ask Questions & Get Answers at ibibo sawaal

Dan Dan's Questions & Answers

122

Rank

7597

2954

274

84

What do you call each 1 or 0 used in the representation of computer data?

Asked by Monica in Computers & Technology at   2:40 PM on November 11, 2008

Dan Dan's Answer

Computer hardware is built to store numbers in `binary'. There are two digits, 0 and 1. So computer hardware works mostly on base two. In base 2, a number 10010 represents
1x16 + 0x8 + 0x4 + 1x2 + 0
Rather high voltage and low voltage

Answered at 2:54 PM on November 11, 2008

Read all answers

Difference between sql server2000 and sql server2005?

Asked by Monica in Computers & Technology at   2:43 PM on November 11, 2008

Dan Dan's Answer

1. In SQL Server 2000 the Query Analyzer and Enterprise Manager are seperate,whereas in SQL Server 2005 both were combined as Management Studio.

2. In Sql 2005,the new datatype XML is used,whereas in Sql 2000 there is no such datatype

3. In Sql server2000 we can create 65,535 databases,whereas in Sql server2005 2(pow(20))-1 databases can be created.

Answered at 2:51 PM on November 11, 2008

Read all answers

Does Java have pointers?

Asked by Vidya Rani in Computers & Technology at   12:31 PM on November 11, 2008

Dan Dan's Answer

No, no, a thousand times no. Java does not have pointers, no way, no how, the daily email I get from people who think differently not withstanding.

Java does have references. A reference is an abstract identifier for an object. It is not a pointer. A reference tags a particular object with a name in the Java virtual machine so that the programmer may refer to it. How exactly the virtual machine implements references at the level of machine code is VM-dependent and completely hidden from the programmer in any case. Most VMs including Sun's use handles, not pointers. A handle is a pointer to a pointer. At the level of machine code in the CPU a reference is an address in memory where the address of the object is stored. This way the objects can be moved around in memory and only the master pointer needs to be updated rather than all references to the object. This is completely hidden from the Java programmer, though. Only the implementer of the virtual machine needs to worry about it. Indeed, this is not the only way references can be implemented. Microsoft's VM actually does use pointers rather than handles. Other schemes are possible.

Answered at 12:53 PM on November 11, 2008

Read all answers

How computers affect society?

Asked by Monica in Computers & Technology at   2:43 PM on November 11, 2008

Dan Dan's Answer

computers affect society in many ways

They allow for complex mathematics which no one human could calculate in a life time.

They allow world wide communication almost instantly.

They allow the possibility of world destruction in a matter of minutes.

They allow satellites for weather tracking and spying.

They control traffic patterns on land and in the air as well as the waterways.

They allow automation of factories.

They allow an increase of knowledge for all of mankind.

They open up business opportunities on the Internet for people who might never have been able to have their own business.

The allow assisted breaking in cars and automatically inflated air bags.

They control inventory.

The assist law enforcement.

They track earthquakes and volcanoes.

They provide entertainment.

Answered at 2:47 PM on November 11, 2008

Read all answers

How many megabytes makes 10 gigabytes?

Asked by Monica in Computers & Technology at   2:43 PM on November 11, 2008

Dan Dan's Answer

Its simple
1GB=1024MB
10GB=10240MB
10240 MegaByte will make 10bigabyte

Answered at 2:49 PM on November 11, 2008

Read all answers

Why isn't there operator overloading?

Asked by Vidya Rani in Computers & Technology at   12:32 PM on November 11, 2008

Dan Dan's Answer

Because C++ has proven by example that operator overloading makes code almost impossible to maintain. In fact there very nearly wasn't even method overloading in Java, but it was thought that this was too useful for some very basic methods like print(). Note that some of the classes like DataOutputStream have unoverloaded methods like writeInt() and writeByte().

Answered at 12:53 PM on November 11, 2008

Read all answers

Why doesn't Java include insert your favorite feature here?

Asked by Vidya Rani in Computers & Technology at   12:34 PM on November 11, 2008

Dan Dan's Answer

The Java language has been extensively debated and argued about within Sun. Almost every language construct of existing languages has already been considered for inclusion in Java. While there may still be room for addition, it is very unlikely that your pet feature will be added to the language spec if it isn't already there. In a couple of years parameterized types (i.e. templates) may be added to the language. Otherwise the spec is pretty much frozen except for minor changes and bug fixes.

Extensions are planned for the class library though. In particular Sun is working on extensions for 3D, multimedia, telephony, and improved graphics.

Answered at 12:52 PM on November 11, 2008

Read all answers

What's an interface?

Asked by Vidya Rani in Computers & Technology at   12:35 PM on November 11, 2008

Dan Dan's Answer

An interface is an idea taken from Objective C. It describes the public methods that a class implements and their calling conventions without saying anything about how those methods are implemented. It is the responsibility of each class that implements an interface to provide code to handle the cases where the methods of the interface are called.

For example suppose you're writing an inventory database. The inventory may include many different items of many different types and classes. However each item in the warehouse needs to be able to tell you its price. Normally you would implement this by having each class extend a common superclass. However that's not always convenient. Instead you can declare an interface called Price with a price() method like this:

public interface Price {

public float price();

}
Any class which implements the Price interface must contain a method with the signature public float price(). The code of the price() method is included separately in each separate class which implements Price, not in the Price interface itself.

Different classes in your warehouse can each implement the Price interface like this:

public class Monopoly extends BoardGame implements Price {

// other methods

public float price() {
return 14.95;
}

}
When other code is passed an object, it can test whether the object implements Price with the instanceof operator. For example,

if (o instanceof Price) System.out.println("Subtotal is " + o.price());

In fact, interfaces can be used to tag objects. The java.rmi.Remote interface declares no methods. Its sole purpose is to indicate that an object is a remote object. In general, sub-interfaces of java.rmi.Remote will declare remote methods, however. For example,

public interface Hello extends java.rmi.Remote {

public String sayHello();

}
public class HelloImpl extends UnicastRemoteServer implements Hello {

public String sayHello() {
return "Hello";
}

}

Answered at 12:51 PM on November 11, 2008

Read all answers

How do I version a class?

Asked by Vidya Rani in Computers & Technology at   12:33 PM on November 11, 2008

Dan Dan's Answer

There is no support for versioning classes in Java 1.0. However in Java 1.1 the serialver tool provides a serialVersionUID for one or more classes you can add to your class as a field. This is used in object serialization.

Answered at 12:53 PM on November 11, 2008

Read all answers

Can I cast an int to an Integer? a float to a Float?

Asked by Vidya Rani in Computers & Technology at   12:34 PM on November 11, 2008

Dan Dan's Answer

No, you cannot promote a base data type like int or float to an object such as an Integer or a Float. However the proper way to do this isn't very hard. Instead do

int x = 5;
myInteger = new Integer(x);

Answered at 12:53 PM on November 11, 2008

Read all answers

Editor's Pick

Categories

sawaal signature
sawaal free visiting card