Forum Replies Created
August 27, 2014 at 5:09 am in reply to: What is difference between path and classpath variables #15526
Answer: PATH is an environment variable used by operating system to locate the executables. A Classpath variable is specific to java and used by java executables to locate class files. Location can be provided to classpath while running java application and it can be a ZIP files, directory, JAR files etc.May 23, 2014 at 11:23 am in reply to: How do you write a function that can reverse a linked-list #15430
head->next = 0;
tail->next = head;
node* pre = head;
node* cur = head->next;
node* curnext = cur->next;
head->next = 0;
cur-> next = head;
for(; curnext!=0; )
cur->next = pre;
pre = cur;
cur = curnext;
curnext = curnext->next;
curnext->next = cur;
}May 23, 2014 at 11:15 am in reply to: advantages of inheritance in C plus plus #15429
Answer: Advantages of inheritance in C++:
May 20, 2014 at 8:54 am in reply to: What is Probability #15407
- It permits code reusability.
- Reusability saves time in program development.
- It encourages the reuse of proven and debugged high-quality software, thus reducing problem after a system becomes functional.
Answer: Probability is a measure of the likeliness that an event will occur. Probability theory is applied in everyday life in risk assessment and in trade on financial markets. Governments apply probabilistic methods in environmental regulation, where it is called pathway analysis.May 20, 2014 at 8:16 am in reply to: Define simple and compound interest #15404
Answer: If the interest on a sum borrowed for a certain period is reckoned uniformly, then it is called simple interest. Let Principal= ‘P’, Rate=R% per annum, and Time= ’T’ years then
Simple interest =((P*T*R)/100)
Compound interest: The formula for calculating compound interest is:
P= principal amount (the initial amount you borrow or deposit)
R = annual rate of interest (as a decimal)
T = number of years the amount is deposited or borrowed for.
A = amount of money accumulated after n years, including interest.
n = number of times the interest is compounded per year
September 3, 2013 at 4:13 am in reply to: What are synchronized methods and synchronized statements #15283
- This reply was modified 9 years ago by Aakanksha.
Synchronized methods are methods that are used to control access to an object. A thread only executes a synchronized method after it has acquired the lock for the method’s object or class. Synchronized statements are similar to synchronized methods. A synchronized statement can only be executed after a thread has acquired the lock for the object or class referenced in the synchronized statement.September 3, 2013 at 4:13 am in reply to: What is the difference between the File and RandomAccessFile classes #15282
The File class encapsulates the files and directories of the local file system. The RandomAccessFile class provides the methods needed to directly access data contained in any part of a file.September 3, 2013 at 4:12 am in reply to: What is casting #15281
There are two types of casting, casting between primitive numeric types and casting between object references. Casting between numeric types is used to convert larger values, such as double values, to smaller values, such as byte values. Casting between object references is used to refer to an object by a compatible class, interface, or array type reference.August 26, 2013 at 4:25 am in reply to: What advantage do Java layout managers provide #15267
Java uses layout managers to lay out components in a consistent manner across all windowing platforms. Since Java’s layout managers aren’t tied to absolute sizing and positioning, they are able to accommodate platform-specific differences among windowing systems.August 26, 2013 at 4:24 am in reply to: What is the purpose of finalization #15266
The purpose of finalization is to give an unreachable object the opportunity to perform any cleanup processing before the object is garbage collected.