Wednesday, 25 December 2013

How java is more secure than other languages?


Java is more secure because of following reasons:-
  • No use of pointer :-
  •             Java do not use the pointers like other languages c,c++.(pointers are variables which holds the memory addresses).These pointers leads to unauthorized access to the memory blocks if some other program get the pointer values,and can change and manipulate the data stored in the systems RAM.But java does not use the pointers,it has its internal mechanism to manage the memory management .Java give the access to the data to the programs which has proper verified authorization.
  • Concept of error handling and exception handling :-
  •           Java provide the exception handling concept which capture series errors and eliminates any risk of crashing the system.Java compiler check all the code lines and check that if there is any line of code that may create error and give warnings to the programmer like "deprecated methods and classes",so that the more effective program can be written by doing changes in the program .It checks the at the time of execution and may create the exception ArrayIndexOutOfBoundExceptionso that these exceptions can be handled without program crash ,and unauthorised memory contents are not accessible and modifiable by any other programs.
  • Strict Data Type Checking:-Java compiler strictly check the data type that is defined to the variables in the program ,so that there unboxing and unboxing operations can not lead to security issues.Java provide wrapper classes to use in place of primitive data types like Integer class to use instead of int data type ,there are many more.
  • Garbage Collector:-Java has its internal garbage collector that automatically deallocate the variables and objects that go out of scope ,so that the and security issue may lead ,and it also effective to put the memory management task in the hand of Garbage Collector ,because the programmer may do mistake in programming logic(like left destruction of objects and pointers)  that may lead to loophole in the security of program.But java is secure in this case.

Friday, 6 December 2013

Why is Java known as platform-neutral language?

Java is known as platform independent because it uses the concept of  generating the byte code of the high level program ,and then run that byte code(intermediate code) on JVM(Java Virtual Machine),now what is JVM,actual JVM is a virtual computer system that run on your original computer system .
   JVM converts the byte code to machine code according to the your original computer's machine architecture(your computer system architecture like x86,ARM etc.).Here is flow how the Java handle your high level program.



      So java compilation is done only once ,after that the byte code can be interpreted on any machine that have JVM.JVM is of different type according to computer system architecture,means for x86 JVM will be different for ARM JVM will be different etc.These are developed by the java vender that is Oracle.This JVM come as a part of JDK(Java Development Kit).
So this compiler and interpreter has make it platform-neutral language.  

Friday, 6 September 2013

List of a few areas of application of OOP technology


  • Now a days OOP is most popular technology among programmers.It is used in the area of designing of user interface windows of every software .


Like:-


In above the design of textbox labels buttons etc are developed using Object Oriented Programming ,because it easy to co relate there working in the manner of Objects. So today all the software development is done in OOP .



  • Real time systems are much complex and contain many more objectives with complicated attributes and methods. So in real time systems OOP is useful because it can simplify a complex problem.We can create complex objects in OOP and can create there communication methods and can get the results .In the coming post we will create Real time objects and see there working  also.

  • Simulation and modelling applications can be created using OOP because in OOP we can handle real time objects and can generate there behavior  in simulation system also.

  • Object Oriented databases are good application of OOP ,in object oriented databases we can handle objects easily,object data can be processed easily.

  •  There are other applications of OOP are:-
  • AI and expert systems 
  • Neural network 
  • Parallel programming
  • Decision Support Systems
  • CIM
  • CAD etc.

Friday, 30 August 2013

What kind of things can become objects in OOP?

When we start programming in OOP(Object Oriented Programming) the things which have some attributes and have some functions will become objects.Here is a example to check that what will become a object:-

Example :-

       Let say you are going to develop a software for the School to take attendance on computers ,so you will start programming in object oriented .You will analyse that in attendance what are the things which have attributes and some functionality.These things will come in your mind like Student,Teacher,Register etc.
    You will analyse that when attendance is taken the teacher take the attendance ,student speak that I am present and register is used to mark the attendance.





So the Program will have following things:-


class Student
{
     string  sName ;
     int      sRollNo;

}
class Teacher
{
      string TeacherName;
}

class Register
{
        Student   StudentList[20];
}


Tuesday, 16 July 2013

Distinguish between Data Abstraction and Data Encapsulation?

Data Abstraction:-Data abstraction means get the desired things.In data abstraction we use the features which we want ,without worry about the implementation.We have not the information how it will be done?Lets have an of real world example
You usually use mobile phone,when you do a call to your friend.Which steps you take (1)Type the number(2)Press the call button.


But you do not know what happens after that how the mobile implement this task to connect you with your friend..So the mobile has only abstract operation only which are type the number and press the call button.

Same as this example we have function of a object in programming, which done the particular task, these functions will do the task in there internal code only without showing it publicly.

Dummy code example:-
You might listen about the Stack which work on the principle to LIFO(Last In First Out).Stack have two operation PUSH and POP.So this function will do the data abstraction means these will do the internal work without telling the internal implementation.User will just use these two functions to do the task.
class Stack
{
       int numbers[]=new number[10];
       int top;
      Stack()
      {
         top=-1;
       }
      public void PUSH(int num)
      {
        ------------------
       }
       int void POP()
       {
        ------------------
        }

     public static void main(String ar[])
     {
             Stack marks=new Stack();
              marks.PUSH(10);
              marks.PUSH(20);
              int get=marks.POP();
           
}
\Note:-this Example is given to understand the concept only it will not be complied by the compiler.Please do not worry we will do this in proper format when you will have the knowledge about syntax etc in coming posts.



Data Encapsulation:-Data Encapsulation means wrapping the data and methods in a single unit.In programming class do the Encapsulation.Like capsule wrap up the medicine in it.

Example:-

class Chair
{
             int height;
             String color;
              Char()
              {
                 
                }
                public void setColor(String col)
                {
                           color=col;
                }
                ------
                ----------
}

So the Chair class is wrapping up the data members and methods in it

     






Thursday, 4 July 2013

Distinguish between Object and class?


Object:-Object is a entity which remain active in the system(Like we are a object which remain active in the world).The Object can represent a person,a place,a bank account etc which is handle by the program.So in programming every problem is analysed in terms of objects and there nature of communication(Like in world we communicate with others ).So when a program is executed these objects  reaming active in system and interact  by sending messages to each other.Remember that these objects do not know the internal details of each others.Lets take an example how objects communicate:-

Objects Communication

When you go to Bank you have to communicate with some one to get information same as objects communicate with each other to exchange information,like in above example the program(software)developed to manage bank account data,that program will have two objects one will be Customer and other will be Account(remember that at the project level there will be so many objects will be created) and they will communicate to do bank transaction.

Class:-We know every objects have data and methods code  to manipulate the data.(like we have some attributes and functionality).The entire set of data and methods code of an object can be made user defined data type using the class.Once a class is defined we can create any number of objects belonging to that class.Example:-

Class Student
{
      String  Name ;
      int age;
      Student(String nm,int ag)
      {
          Name=nm;
          age=ag;
      }
      public static void main(String arg[])
      {
          Student Steve=new Student("Stave",21);
          Student John=new Student("John",19);
}

So in above example student is a class,Stave and John are objects of Student class

Tuesday, 2 July 2013

What are the advantages of Object Oriented Programming Approach?

There are Following Advantages of Object Oriented Programming:-

  • Using Inheritance we can remove the redundant code and can extends the existing classes.
  • We can develop the programs in standalone modules that communicate with each other to do specific task,so we can start the development from already available code and we do not required to start from scratch.(we will see later how to use the already available code in class packages)
  • Using the principle of data hiding helps the programmers to develop secure programs that cannot hacked.
  • We can add the new features(modules) in a software code ,without effecting the previously working modules.
  • We can match the objects and their working easily.
  • It is easy to understand the working of complex objects in object oriented programming.