Forum Replies Created
-
AuthorPosts
-
August 27, 2014 at 5:09 am in reply to: What is difference between path and classpath variables #15526
Aakanksha
ParticipantAnswer: 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 #15430Aakanksha
Participantanswer
void reverselist(void)
{
if(head==0)
return;
if(head->next==0)
return;
if(head->next==tail)
{
head->next = 0;
tail->next = head;
}
else
{
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;
}
}Aakanksha
ParticipantAnswer: Advantages of inheritance in C++:
- 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.
Aakanksha
ParticipantAnswer: 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.
Aakanksha
ParticipantAnswer: 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:
Amount=P(1+R/100)n
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-
This reply was modified 9 years ago by
Aakanksha.
September 3, 2013 at 4:13 am in reply to: What are synchronized methods and synchronized statements #15283Aakanksha
ParticipantSynchronized 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 #15282Aakanksha
ParticipantThe 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.
Aakanksha
ParticipantThere 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.
Aakanksha
ParticipantJava 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.
Aakanksha
ParticipantThe purpose of finalization is to give an unreachable object the opportunity to perform any cleanup processing before the object is garbage collected.
-
AuthorPosts