OBJECT ORIENTED PROGRAMMING CIS 3100

108 define multitasking or multithreading

This preview shows page 15 - 18 out of 54 pages.

108. Define Multitasking or multithreading. Multitasking or multithreading is the ability to execute several programs simultaneously. A program that contains multiple flows of control is known as a multithreaded program. 109. What are the ways to create a thread? A thread can be created in two ways, • By creating a thread class – extends Thread class • By converting a class to a thread – implements Runnable interface 110. How do you stop and block a thread? A thread can be stopped using the stop (). It can be blocked using sleep (), suspend () and wait () methods. 111. What are the states in the life cycle of a thread? The various states are, • Newborn • Runnable • Running • Blocked • Dead 112. Define synchronization? Synchronization is the process by which only one class is allowed to access a member function at a time. It is done using the qualifier ‘synchronized’. e.g., synchronized void show () {……..} 113. Define error. What are its types? An error is a wrong that can make a program go wrong. There are two types of errors namely, • Compile time errors • Run time errors
Image of page 15

Subscribe to view the full document.

114. What is an exception? What are the steps involved in exception handling? (April/May 2011) (Nov/Dec 2011) An exception is a condition that is caused by a run time error in a program. The steps involved in exception handling are, • Hit the exception • Throw the exception • Catch the exception • Handle the exception 115. Give the syntax of exception handling code. The syntax of exception handling code is given by, try { statements } catch ( Exception-type e) { statements } 116. What is an applet? What are its types? An applet is a small java program that is primarily used in internet computing. The types of applets are, • Local applets • Remote applets 117. What are the various states in an applet life cycle? The various states in an applet life cycle are, • Born or initialization state • Running state • Display state • Idle state • Dead or destroyed state PART B 1. What are the Features of oop’s & how are they implemented in C++? (Nov/Dec 2010) (April/May 2011) (Nov/Dec 2011) • Objects • Classes • Data Abstraction and Encapsulation • Inheritance • Polymorphism • Dynamic Binding • Message Passing 2. Explain about inline function? (Nov/Dec 2011) An inline function is a function that is expanded in line when it is invoked. The compiler Replaces the function call with corresponding function code. The inline funcitions are defined As follows: inline function-header { Function body; }
Image of page 16
Example: inline double cube(double a) { Return(a*a*a); } Some situations where inline expansion may not work are: For functions returning values, if a loop , a switch, or a goto exists. For functions not returning values, if a return statement exists. If functions contain static variables.
Image of page 17

Subscribe to view the full document.

Image of page 18

{[ snackBarMessage ]}

Get FREE access by uploading your study materials

Upload your study materials now and get free access to over 25 million documents.

Upload now for FREE access Or pay now for instant access
Christopher Reinemann
"Before using Course Hero my grade was at 78%. By the end of the semester my grade was at 90%. I could not have done it without all the class material I found."
— Christopher R., University of Rhode Island '15, Course Hero Intern

Ask a question for free

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern