This is default featured post 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Tuesday, 30 April 2013

What Are the Features of Java?

Features of any Programing language are nothing, but the service or the basic facilities Provided by the language to the Industry program for the development of Real-World application.

The Java Programing language Provides thirteen(13) Features:


1. Simple

2. Platform Independent

3. Architecture neutral

4. Portable

5. Multi threaded

6. Network

7. Distributed

8. High performance

9. Robust (strong)

10. Interpreted

11. Dynamic

12. Secured

13. Object Oriented Programing

Simple:


Java is of the simple programing language, because of the following factors.

The language Java doesn't support the concept of pointers that is  java language is Free From pointer. Hence we get less application development time and less application execution time because of the magic of byte code.

 

Platform independent:


A platform Independent language oblique technology is one whose related application run on every operating system without considering their vender.
Architectural Neutral:

An Architectural Neutral  application is those, which are running on every processor without considering These Vendors and Artie.

 

Portable:


A portable application is one, which runs on every operating system  and processor without considering Archie and vendors.

The applications of C,C++,Pascal,cobalt, etc. are treated as Non-portable application.

The applications of java are by default portable, according to  the sun micro system portability is equal to platform independent plus architectural  neutral.

                                                    portable=P.I+A.N

Industry is always recommended to develop the distributed application with portable technology only but not by non-portable technology, because the developer needed not to spend many amounts of time to write a special programing to run of every operating system   on  a processor.

 

Multi threaded:


The basic aim of multi threading is to achieve concurrent execution. A flow of control is known as thread. The basic purpose of thread is to execute user defined methods. IF a java program is containing multiple flow of control than that java program is known as Multi threaded.

 

Network:


The basic aim of networking is to share the data between multiple machine, which are located either in same network or in the different network.

A Network is a collection of " inter connected Atamous/non autonomous computer connected to the server."

 

Distributed: 


According to industry standards, every Java application is distributed application, based on the running process of the java project java projects are classified into two types.

They are 1.Centralized application 2. Distributed application

A centralized application is one, which run within the context of single server, and it can be access across the global by authorized people.

Example is SBI application.

Distributed application is one, which run within the context of multiple servers, and it can be access as across the globe by both authorize and unauthorized people.

Example is Yahoo.

 

High performance:


Java is one of the high-performance languages because of the following factors.

1. Magic of byte code.

2 Inbuilt garbage collection.

The above two factors given by sun

 

Robust (strong):


When ever we write any program in any language, we get two types of errors, these compile time error and Run time error.

Compile time error are those which are listed during  of the program provided. The Programmer is not following the syntax of the language.

Run time error are those which occur during execution of the program provide the normal user enter invalid input.

Run time error in the java program are known as exception.

The basic advantage of java language is that, it can handle all types of Run-time errors, and it gives as a suitable message to the normal user.

 

Interpreted:


In the older version of java compilation phase is very faster and interpreted phase is slow ,this one of the complain given by an industry programmer to the sun micro system.

Sun micro system as return a program like JIT(just in time compiler) and added a part of JVM to speed up the interpreted phase by reading the entire section of byte code and converting into native understanding form of OS. Hence in the current version of java interpreted  phase is very fast than compilation phase of java. Sun micro system has populated java is one of highly interpreted programing language.

 

Dynamic:


If we write any program during its run time whatever input, we are entire, that input must be stored in main memory of computer by allocating sufficient memory space the memory can be allocated in any program language in two ways.

There are

1.Static/compile time memory allocation.

2. Dynamic /run time memory allocation.

Java program language never follows static memory allocation, but it always follows dynamic memory allocation but making New Operation.

Since java is following dynamic memory location sun micro system has populated, it is as one of the Dynamic program languages.

 

Secured:


Security is one of the principles invented by industry expert to prevent the confidential information from an unauthorized user.

Monday, 29 April 2013

What Is Different Between FTP and HTTP? What Is Stateless and State Full Protocols?

                    FTP

                   HTTP

1. It is one of Protocol comes under UDP.

1. It is one of protocol comes under TCP.
2. FTP is of the non acknowledgment oriented protocol.

2. Http is of the acknowledgement oriented protocol.

3. FTp is one of the state full Protocol.

3. Http is of the stateless protocol.

4. FTP is use in low level application (other than internet Application).

4. Http is used in high level Application ie internet Application.

Definition of Stateless Protocol:


A stateless Protocol is one ,which maintains an identity of the client for a limited spam of time.

Example of stateless protocol:

HTTP

Definition of Sate full Protocol:


A State full  protocol is One, which maintain an Identity of client Forever.


Example of State-full Protocol:

FTP

Tuesday, 23 April 2013

What Is Pure Virtual Function? Why and When It Is Used?

If any virtual Function It Containing Signature with nobody, this is known as  Incomplete Function and  also known as Pure virtual Function.

In virtual function, the main disadvantage is wastage of code. This can overcome using Pure Virtual Functions.


Syntax: 

virtual Return Type Function_name()=0;

Pure virtual function also should be preceded by Virtual keyword, Zero should be assigned to function(represent incomplete function).

Pure Virtual Function always contained only Signature, but nobody parted.

Rules To Declared Pure Virtual function:


1. Every Pure virtual function should be declared in the public scope of Base class.

2. IF any class contained at-lest one pure virtual function that becomes abstract class, Every abstract class should  be inherited in at-least One Class.

3. Every pure virtual function of Base class should be declared in public scope of derived class with body part or without.

4. Pure Virtual Function always should be called using based class pointer Object.

5. If any class contained at-least one pure virtual function is known as obstruct class.

6. One class can contain any number of Pure virtual Function.



Sunday, 21 April 2013

Traversing a Single Linked List

Traversing a SLL

  The following method traverses a list (and prints its elements):


 Cell insertAtFront(Cell oldFront, Object value) {
    Cell newNode = new Cell(value, oldFront);
    return newNode;
}
 
 Use this as:  myList = insertAtFront(myList, value);

Why can’t we just make this an instance method of Cell?

Using a header node

A header node is just an initial node that exists at the front of every list, even when the list is empty. The purpose is to keep the list from being null, and to point at the first element

 inseritn a node after a given number
Inserting a node after a given value


 void insertAfter(Object target, Object value) {
    for (Cell here = this; here != null; here = here.next) {
          if (here.value.equals(target)) {
              Cell node = new Cell(value, here.next);
              here.next = node;
              return;
          }
}
    // Couldn't insert--do something reasonable here!
Inserting after (animation)

Deleting a node from sll

Deleting a node from a SLL

  1.  In order to delete a node from a SLL, you have to change the link in its predecessor
  2.  This is slightly tricky, because you can’t follow a pointer backwards
  3.  Deleting the first node in a list is a special case, because the node’s predecessor is the list header

Deleting an element from a SLL

To delete the first element, change the link in the header

delete the first elemetn

To delete some other element, change the link in its predecessor
delete some other element

Deleted nodes will eventually be garbage collected

Doubly-linked lists

   Here is a doubly linked list (DLL):

double linked list

 Each node contains a value, a link to its successor (if any), and a link to its predecessor (if any).The header points to the first node in the list and to the last node in the list (or contains null links if the list is empty)

DLLs compared to SLLs


compared to sll

 Advantages:


It can be traversed in either direction (may be essential for some programs)    Some operations, such as deletion and inserting before a node, become easier.

Disadvantages:


It requires more space. List manipulations are slower (because more links must be changed). Greater chance of having bugs (because more links must be manipulated)

Deleting a node from a DLL


deleting a node form double linked list


  1.       Node's deletion from a DLL involves changing two links.
  2.       In this example, we will delete node b.
  3.       We don’t have to do anything about the links in node b.
  4.       Garbage collection will take care of deleted nodes.
  5.       Deletion of the first node or the last node is a special case.

Other operations on linked lists


Most “algorithms” on linked lists—such as insertion, deletion, and searching—are pretty obvious; you just need to be careful.

 Sorting a linked list is just messy, since you can’t directly access the nth element—you have to count your way through a lot of other elements.

What Is Virtual Funtion?

Virtual Is a Keyword in C++, whenever it is Preceded by any Function known as Virtual function.


When Derive a class overrides the base class method by redefining the same function, then  if a client wants to access redefined the method from derived class through a pointer from base class object, then your function defined this function as Virtual function.Virtual function mainly used to restrict overriding.

 Syntax:
  class <class name1>
                 {

                           Public: Virtual return type function()
                                           {
                                            --------------
                                           ------------------
                                             --------------
                                           ------------------

                                           }
              };

               
              Class <class name2>:public <class name1>
            
             {

                           Public: return type function()
                                           {
                                            --------------
                                           ------------------
                                            --------------
                                           ------------------

                                           }
              };



Rules to Declared Virtual Function:


1. Every Virtual Function should be identified with a virtual keyword.

2. Every virtual function should be declared in the Public scope of base class.

3. If any base class contains at least one virtual function known as Virtual Base class, every virtual base class should be inherited at least in one class.

4. Virtual function of base class should be Re declared in the public scope of derived class.

5. Virtual function of both base and derived class should be called using based class pointer Object.

6. One Base class can contain any number of virtual function as well as normal function.

7. One virtual base class can be Inherited. In any number of another class.

8. Normal Function of virtual base class can be called using any type of derived class object.



Friday, 19 April 2013

Single Linked List


Singly-linked lists



singly-linked-list




  Here is a singly linked list (SLL):

 Each node contains a value and a link to its successor (the last node has no successor)
 The header points to the first node in the list (or contains the null link if the list is empty)



Creating a simple list



    To create the list ("one," "two," "three"):


 Cell numerals = new Cell();
   numerals =
    new Cell("one",
        new Cell("two",
            new Cell("three", null)));
 

Wednesday, 17 April 2013

Linked List in Java

A linked list consists of sequence of nodes.

linked_list


Each node contains a value and a link (pointer or reference) to some other node. The last node contains a null link. The list may (or may not) have a header.

More terminology

A node’s successor is the next node in the sequence the last node has no successor node’s predecessor is the previous node in the sequence. The first node has no predecessor list’s length is the number of elements in it list may be empty (contain no elements).


Pointers and references

  In C and C++, we have “pointers,” while in Java, we have "references," This  is essentially the same thing, The difference is that C and C++ allow you to modify pointers in arbitrary ways, and to point to anything, In Java, a reference is more of a “black box,” or ADT.

 Available operations are:

DE references (“follow”)

  copy

  Compare for equality

There are constraints on what kind of thing is referenced: for example, a reference to an array of into can only refer to an array of into.

 Creating references

  The keyword new creates a new object, but also returns a reference to that object.

  For example, Person p = new Person("John")

   New Person("John") creates the object and returns a reference to it.

  We can assign this reference to p, or use it in other ways.
linked list



 class Cell {
     int value;
     Cell next;

     Cell (int v, Cell n) { // constructor
     value = v;
     next = n;
}
     }

     Cell temp = new Cell(17, null);
     temp = new Cell(23, temp);
     temp = new Cell(97, temp);
     Cell myList = new Cell(44, temp);






Friday, 12 April 2013

Explain About Constant Pointer and Pointer to Constant

1. constant pointer :-

Constant Pointer mean we can't change the address of Pointer but we can change the value.That is Pointer is pointing to constant address.

 Syntax:-
  int* const ptr    

#include<stdio.h>
int  main()
{
    int num=10;
    int* const ptr = &num;
   int *anotherptr;
   int number=1000;
   printf("The before num value is:%d\n",*ptr);
  *ptr = number;
   //ptr=anotherptr; because we can't change the address of ptr
   printf("The num after value is:%d\n",*ptr);
  return(0);
}

2.pointer to constant :-

 Pointer to Constant means we can't change the value but we can change the address of Pointer. That is value is constant.

Syntax:-
 const int *ptr;


 #include<stdio.h>    
int  main()
{
     int num=3;
    const int *ptr = &num;
    int *AnotherPtr;
    int a=1000;
    Anotherptr=&a;
    printf("Before:The num value is:%d\n",*ptr);
   //*ptr = 5; we can't change the value because it's const
    ptr=Anotherptr;
    printf("After :The num value is:%d\n",*ptr);
   return(0);
}

Wednesday, 10 April 2013

Different Between Structure and Union

Different Between Structure and Union  :-


                      Structure

                      Union

We call access all the members of structure at a time.
Only one members can be accessed at a time.
Memory is allocated for all variable.
Memory is allocated for variable which variable require more memory.
All members of structure can be initialized.
Only the first member of a union can be initialized.
Struct keyword is used  to declare structure.
Union keyword is used to declare union.
All  members of structure stores in unique memory location.
All members of union stores in same location.
Syntax

 Struct

    {

       Int a;
       Float b;
  }var;
Syntax

union
    {

     Int a;
     Float b;
    } var;
Instruction pipelining can be implemented easily.
  Instruction pipelining can not be implemented easily.


Monday, 8 April 2013

Difference's Between Risc and Cisc

Difference's   Between Reduced instruction Set computer(RISC) and Complex Instruction Set Computer(CISC) are follows

                              RISC
                      CISC
RISC stands for Reduced Instruction Set Computer.
CISC - for Complex Instruction Set Computer.
Fewer register.
Many register.
Less complex microcode.
Complex microcode.
RISC systems shorten execution time, by reducing the clock
cycles per instruction (i.e. simple instructions take less time
to interpret).
CISC systems shorten execution time, by reducing the
number of instructions per program.

Mainly used for real time applications.
Mainly used in normal PC’s, Workstations and servers .
Examples of RISC Processors: Atmel AVR, PIC, ARM.

Examples of CISC Processors: Intel x86.
Instruction pipe lining can be implemented easily.
  Instruction pipe lining can not be implemented easily.


Sunday, 7 April 2013

What Are the Difference's Between C Programming and Embedded C

Difference's  Between C Programming and Embedded C are follows:-

                  C Programming
                Embedded C
C is a widely used general purpose high level Programming language ,mainly intent for system Programming.
Embedded C is  an extension to c Programming language, that provide support for developing efficient programs for embedded device. Embedded c is not a part of C language.
C is usually for desktop Programming.
Embedded c is more suitable for embedded programming unlike c.
C creates os dependent executable file.
Embedded c creates files that are typically download into Microcontroller.
C can’t talk directly to Target device.
Embedded  C allows Programmer to directly talk to the target processor, and therefore provides improved performance compared c.

Saturday, 6 April 2013

What Is Difference's Between Microcontroller and Microprocessor

Difference's Between Micro-controller and Microprocessor are follows:-

                  Microcontroller
                   Microprocessor
Microcontroller is more specific to its tasks.
Microprocessor has more generalized functions.
Microcontroller is like a computer inside a single chip.
Microprocessor is the CPU in computer.
Microcontroller is a device, which integrated a number of the components of a microprocessor system into a single microchip.
Microprocessor is the integration of a number of useful functions into a single IC package.

Microcontroller has separate ROM and RAM.
No memory.
Few opcodes more bit handling instruction.

More opcodes few bit handling instruction.

Input output ports and timers are present.


No input output ports and timers.
Cost is low.

  Cost is more.

Programmer can’t decide memory.
Programmer can decide memory.

What Are the Difference's Between ISR and Function Call

Difference's Between  Interrupt Service Routine(ISR) and Function Call are Follows:-

                    ISR 
                   Function call
1, ISR will be executed only when the system is interrupted.

1. Function call meant for any operation to perform ,even thought when there is no interrupt.
2. ISR is the priority oriented.

2. Function calls are waiting to complete they routines whenever we call.

3. ISR has no return value.

3. Function has a return value.

4. ISR has no parameter.

4.Function has a parameter or not ,Decide by the Programmer.

5. ISRis triggered by hardware event.

5. Function call is triggered by function caller.


6. ISR is only executed when the interrupt is triggered .



6. Function is only executed when the function caller called the function .

7 function call the arguments, local  variable and return address is stored in the stack .


7. ISR after execution the current instruction the context is saved with no return value .



Friday, 5 April 2013

How to Decide Given Processor Is Little Endian or Big Endian

 What are Little Endian and Big Endian

Big endian and little endian are the  terms,that tells the order in which sequence bytes are stored in memory.

Big Endian

Big Endian-Most Significant byte is stored at the lowest address.

Little Endian 

Little Endian-lest Significant byte is stored at he lowest address.

The binary representation of integer 5193 in 2 bytes is



0001  0100       0100 1001
 MS byte            LS byte


The following  figure show how this integer is stored in different byte order

Little Endian 

 Address:-


 2000            0100    1001  LSB
 2001            0001    0100  MSB


Big Endian 

Address:-


2000         0001 0100  LSB
2001         0100 1001  MSB

By write a below program we can find little Endian machine and Big Endian machine.


#include<stdio.h>
int main()
{
    unsigned int k=1;
    char*c=(char*)&k;
    if(*c)
    printf("Little endian");
    else
    printf("Big endian");
    getchar();
    return(0);
    system("pause");
}         
                                       
                                              

  

Twitter Delicious Facebook Digg Stumbleupon Favorites More