What is the difference between TCP/IP and UDP?
TCP/IP is a reliable connection oreinted network protocol. It ensure that a file sent from one network node to another node is a complete file.
UDP is a connectionless, unreliable network protocol.
UDP is faster than TCP/IP. UDP is used where the speed of data transmission is more important than reliability.Reply
What is a stream and what are the types of Streams and classes of the Streams?
A stream is sequence of flowing data. Stream is an abstract class in Java, that is used to either read the data or write the data to/from a disk file, device, a network socket, other programs, a memory array etc.
There are two types of streams that Java support :
* Byte oriented streams.
* Characters oriented streams.
Classes of the Streams :
What is UNICODE?
Java uses the unicode character set for all the characters and symbols of the world. The Unicode provides the Standard character set to support all language, platform, program. Before the invention of Unicode, many different character sets and encodings had to be used for different languages. It was not possible to store plain text files containing text from languages using different character sets in the same document. Unicode provides a unique number for every character. The Unicode Consortium is a non-profit organization founded to develop, extend and promote use of the Unicode Standard, which specifies the representation of text in modern software products and standards. Reply
What is an Object and how do you allocate memory to it?
An object is a runtime entity. It is an instance of the class and have its own state, made up of values assigned to all variables of its class collectively. An object will hava access to all the behaviours(methods) of its class.
The object can be allocated memory using the "new" keyword. For Example :
CreateObject o = new CreateObject();Reply
What is HashMap and Map?
Map is an Interface and HashMap is a class that implements the Map interface. HashMap is not serialized.Reply
What is static typig?
Assignment of value to the variable at the time of variable declaration is called static typing.Reply
What is dynamic typing?
In most of the programming languages, variables can be assigned value in two ways : First, at the time of variable declaration. Second, later in the program. If you assigned value to variable later in the program, then the varaible will not hava a value at the time of compilation, it will be assigned a value at runtime. This runtime assignment of value to variable is called Dynamic typing.Reply
If aaaa is an array then why aaaa.length why not aaaa.length()?
In Java API, we have an Array class which has a variable named "length" to count the length of the array, hence we say, aaaa.length to count the length of the array.
In the String class, we have a method named length(), which returns the length of the string. Reply
What are the restrictions placed on the values of each case of a switch statement?
The restrictions placed on the values of each case of a switch statement are :
* The values of each case of a switch statement must be a compile time constant.
* Only use the values that can be promoted to an int value, i.e. use byte, short, char, int only.
What are the drawbacks of inheritance?
Drawbacks of inheritance :
* Difficulty of understanding complex hierarchy.
* Makes writing a compiler harder, e.g. requires more dynamic type checking since type of an object can change during runtime.
* Adversely affects execution speed, program size, program complexity, and incurs method passing overhead.
* Inheritance forces a set of methods and fields on a class. You may not want some of these, and it is not necessary that all of these are required. There is no concept of partial inheritance.
* Interface stability of base classes sometimes require even more complexity.Reply