0% found this document useful (0 votes)
5K views

Process Based Multitasking V/s Thread Based Multitasking

Process Based Multitasking V/s Thread Based Multitasking Core Java Programming Differences Shree M. & N. Virani Science College, Rajkot

Uploaded by

shukerullah
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5K views

Process Based Multitasking V/s Thread Based Multitasking

Process Based Multitasking V/s Thread Based Multitasking Core Java Programming Differences Shree M. & N. Virani Science College, Rajkot

Uploaded by

shukerullah
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Core Java Programming Differences Shree M. & N.

Virani Science College, Rajkot

(1).

Process Based Multitasking V/s Thread Based Multitasking

Process Based Multi-tasking A process is essence of program that is executing which running parallel It allows you to run java compiler and text editor at a same time.

Process multitasking has more overhead than thread multitasking. Here, it is unable to gain access over idle time of CPU. It is not under control of java. Process based multitasking is comparatively heavyweight process comparing to thread based multitasking. Inter-process communication is expensive and limited.

Thread Based Multi-tasking Thread is a such part of multithreaded program which defines separate path for execution It doesnt support java compiler and text editor run simultaneously. Both have performed different tasks. Thread multitasking has less overhead than process multitasking. It allows taking gain access over idle time taken by CPU. It is totally under control of java. Thread based multitasking is known to be lighter eight process.

Inter-thread communication is inexpensive and context switching from one thread to other. It has slower data rate multitasking. It has faster data rate multithreading or tasting.

By : Vaishali Vithalani

Core Java Programming Differences Shree M. & N. Virani Science College, Rajkot

(2).

Method Overloading V/s Method Overriding Method overriding Overriding occurs when a class declares a method that has same type of signature. Overriding is a compatibility of java program because each overridden method has provided for unique implementation. Overriding allows programmer to add other functionalities to its method is classes. Java compilers issues an error message it method overrides another method has different return type. It uses super class reference to super class object. Overriding requires super & sub class for different method. Versions of Java are an example of overriding. Constructor cant be overridden.

Method overloading It occurs when two or more method have same name with different signature. It is used in java program frequently because it allows using the same name for group of method that basically has same purpose. Overloading allows programmer to use different functionalities to a same named method. Java complier issues on error message because it is unable to determine which form to use. It allows easy handle to default parameters. It can occur within a class in different method. Println ( ) is example of overloading. Constructor can be overloaded. (3).

Byte Stream V/s Character Stream Character stream Character stream provides convenient means for handling I/O character. Character stream were included in 1.1 versions. At the top there are two main abstract classes reader & writer. It has to handle Unicode character streams.
By : Vaishali Vithalani

Byte stream Byte stream provides convenient means for handling I/O if byte. Byte stream were included in java 1.0 version. At the top there are two main abstract classes input stream & output stream. Concrete subclasses to handle devices like file, n/w

Core Java Programming Differences Shree M. & N. Virani Science College, Rajkot

connection and memory buffers. Read ( ) & write ( ) methods Read ( ) & write ( ) methods respectively read & write byte of respectively use read and write data. These methods are overridden character at data. These methods are from byte stream class. overridden from character stream class. Both provide API & partial Both provide API & partial implementation for input stream implementation for reader. Writer output stream whose size is 8 but whose size is 16 but character. byte. Handle text file. Handle binary file.

(4).

Type Casting V/s Type Conversion

Type casting Type casting takes between incompatible types.

place

In java there is no such concept of automatic type casting. Type casting is allowed explicitly. Wrapper classes and special methods are used in type casting.

Type conversion Type conversion can take place in both compatible & incompatible types. In java type conversion is automatically done between compatible types. Type conversion is allowed implicitly. Narrowing & widening conversion method are used in type conversion.

(8).

Vector V/s Array Array Convenient to use simple data types. Size can be explicitly specified. Save data types based values are stored. Arrays do have fix dimension. Arrays cannot support this
By : Vaishali Vithalani

Vector Convenient to use & store object. Size can be varied for strongly object. Different types of objects are stored. Vector has no dimension. By converting simple type to

Core Java Programming Differences Shree M. & N. Virani Science College, Rajkot

object by using wrapper class.

particular feature.

(9).

String V/s String Buffer

String String Buffer String represents fixed length, String buffer represents growimmutable character sequences. able & writable character sequence. String argument stores String buffer allocates characters without reallocation. reserves room for 16 characters. It uses extra fragmentation for String can be use as primitive String buffer are not used as data type. data type. Literals directly can be String buffer cant use literals assigning to string. as string directly. String doesnt have String buffer defines following constructors to define. string buffer ( ) string buffer (int size) string buffer (string s)

(10). Interface V/s Abstract Class Interface Abstract class Interface is use to be Abstract class is use to implemented in java programs. extend in java program. Object can be taken of Object can not be considered. interface. Interface is use as reusability Abstract class is not useful as of codes. reusability as codes. Can be define & declare in Method can be declare in base class. abstract class and must be used in subclass. Syntax of Interface: Syntax of Abstract Class: interface <name> abstract class <class name> { { variables method. variable method. } }

By : Vaishali Vithalani

You might also like