Friday, 29 May 2015

Data Types In Python

By With No comments:
Data types using we can different types of data stored in memory. For example, we can stored employee name using alphanumeric character  types and her age and id are  numeric types. These all types of data stored in python using data types.

Python Provide Five Types Of Data Types Such As :
  • Numbers
  • String
  • List
  • Tuple
  • Dictionary
Python Numbers  :

Python numbers data types store numeric values. In python number data types in we have use integer numbers, floating points numbers, and complex numbers.

Example

abc  =  10
abc1  =  20.52
abc2  =  45.e

Here example in we show first variable abc in we stored 10 numeric values, second variable abc1 in we stored 20.52 floating point values and third variable abc2 in stored 45.e complex number, so we understand numbers data types in we can stored integer, floating point and complex number.

Python String  :

String data types in python represents text information in our python program. Strings in python we can create using single quotes or double quotes. Anything within quotes is a string in python.

Example

abc  =  ‘Hello world’
abc1 =  “Hello friends”
print abc
print abc1

Output

Hello world
Hello friends

Python Lists  :

Python in list data type is mutable. This means that the elements in a list can be changed after it is created. The list can contain mixed data types. List contain items separated by commas and enclosed with in square brackets ([]).

List is similar functionality of arrays in c language but small difference is array stored same type of data and list is stored different data types.     
List in stored elements are access using the slice operator ( [ : ] ) with index position start with 0.

Example

lst = [123, ‘abc’, 50.20, ‘xyz’]
print lst
print lst[0]
print [0:2]
print[1:]

Output

[123,  ‘abc’, 50.20, ‘xyz’]
123
[123,  ’abc’]
[ ‘abc’, 50.20, ‘xyz’]

Python Tuples  :

Python in tuples is an immutable data types. A tuple consists of a number of values separated by commas, like list. Tuples are enclosed with parentheses ( () ).

The difference between tuples and list is :
  • Tuples enclosed with parentheses ( () ) and list enclosed with in square brackets( [] ).
  • Tuples is immutable type and list is mutable type of data types.


Example

tuple  =  ( 123, ‘abc’, 50.20, ‘xyz’, 286)       
print tuple                                   
print tuple [ 0 ]                            
print tuple [ 1 : 3 ]                      
print  [ 2 : ]                                   

Output

( 123, ‘abc’, 50.20, ‘xyz’, 286)
123
( ‘abc’, 50.20 )
( 50.20, ‘xyz’, 286 )

Python Dictionary  :

Python in dictionary data types are kind of hash table type. Dictionary is a group of key-value pairs. The elements in a dictionary are indexed by keys. Keys is unique in dictionary data types.
Dictionaries are enclosed by curly brackets ( { } ) and element of dictionary access using square brackets ( [ ] ).     

Example

dic  =  { }
dic [ ‘one’ ]  =  “First Position”
dic [3]  =  “Third Position”
dict1  =  { ‘ Name ’ :  ‘ James  ’, ‘ Pin  ’: 385001, ‘ Designation ’:  ‘ Engineers ’  }
print  dic [ ‘ one ’ ]
print dic [ 3 ]
print dict1
print dict1.keys()
print dict1.values()

Output

First Position
Third Position
{ ‘ Name ’ :  ‘ James  ’, ‘ Pin  ’: 385001, ‘ Designation ’:  ‘ Engineers ’  }
{ ‘ Designation ’, ‘ Pin  ’,  ‘ Name ’}
{ ‘ Engineers ’,  385001, ‘ James ’ }

Data Types In C

By With No comments:
In c programming language any of the data should be declare before it can be used in program. Data types in c are used for assigning a type to a data. Data Types of any variable define how much space occupies in memory storage.

Data Types In C

Data types in c can be classified as follows :
      
                  1)      Basic Data Types
·         Integer types
·         Floating Point Types
·         Character Types
                 2)      Derived Data Types
·         Arrays
·         Pointer
·         Structures
·         Union Types
·         Function Types

Integer Data Types

Integer data types is used when the declare variable with integer type. We can declare integer data type using the “int keyword.

Example

int abc;
Here, int is integer data type and abc is the variable.

Following detail about integer types with storage sizes and value ranges. 

Data Type


Storage Size

Value Range
Char
1 byte
-128 to 127 or 0 to 255
unsigned Char
1 byte
0 to 255
signed Char
1 byte
-128 to 127
int
2 or 4 bytes
-32,768 to 32767
unsigned int
2 or 4 bytes
0 to 65,535
Short
2 bytes
-32,768 to 37,767
unsigned short
2 bytes
0 to 65,535
Long
4 bytes
-2,147,483,648 to 2,147,483,647
unsigned long
4 bytes
0 to 4,294,967,295

Floating-Point  Data types

Floating point data type stored floating point values such as 1.25, -65.20, 0.55 etc. We can declare floating point data types using “float” or “double” keyword.

Example

float abc1;
double abc2;

Here float and double are floating point data types define and abc1 and abc2 are variable. Main difference between float and double are sizes because float size is 4 bytes and double size is 8 bytes.

Following detail about floating-point types with storage sizes and value ranges.

Data Type


Storage Size

Value Range
float
4 bytes
1.2E-38 to 3.4E+38
double
8 bytes
2.3E-308 to 1.7E+308
long double
10 bytes
3.4E-4932 to 1.1E+4932

If we want to get exact size of the data types in c language so we use the sizeof operator. Sizeof operator return the size of data types.

Example

#include <stdio.h>
#include <float.h>
 int main()
{
printf(“Size of integer type is  :  %d \n”, sizeof(int));
printf(“Size of float type is : %d” , sizeof(float));
return 0;
}

Output

Size of integer type is  :  4
Size of float type is  :  4

Thursday, 28 May 2015

Constructor In Java

By With No comments:
Constructor is special type of method in java used to initialize the object. Constructor is invoked at the time of object creation.

Rules For Creating Java Constructor

Basically two things keep in mind when we create constructor such as :
      1)  Constructor name must be same as its class name
      2)   Constructor must have no explicit return type   

Types OF Constructor In Java

There are two types of constructor in java such as:
       1)      Default Constructor
       2)      Parameterized Constructor

Default Constructor In Java

A constructor that have no parameter(argument) is known as default constructor.

Syntax Of Default Constructor

class_name()
{
  //  Code Of Block
}

Example Of Default Constructor

class Hello
{
Hello()              // Default Constructor
{
System.out.println(“Hello World”);
}
Hello obj = new Hello();
}

Output

Hello World

Parameterized Constructor In Java

A constructor that have parameters (arguments) is known as parameterized constructor. It is used when we give different values to distinct object.

Syntax Of Parameterized Constructor

class_name(parameter1,parameter2,……….)
{
  //  Code Of Block
}

Example Of Parameterized Constructor

class Emp
{
int empid;
String name;
Emp(int I,String n)
{
empid = I;
name = n;
}
void show()
{
System.out.println(empid+“  ”+name);
}             
public static void main(String ar[])
{
Emp e = new Emp(1,“john”);
Emp e1  = new Emp(2,”david”);
e.show();
e1.show();
}
}

Output

1 john

2 david

Wednesday, 27 May 2015

Components Of Java Development Kit (JDK) In Java

By With No comments:
Before you can start writing java program, You need to install some kind of java programming software (tools).

Components Of JDK (Java Development Kit) Are :           

Java Compiler Java Compiler use for converts source code into java bytecode. Java compiler component of jdk is used in java programming using “javac” command.  
Java Interpreter – Java interpreter is the loader for java applications. It is used for Interpret the java file that are compiled by java compiler. Java interpreter component of jdk is used in java programming using “java” command.

Java Applet Viewer – Java applet viewer is can be used to run and debug java applets without a web browser.  Java applet viewer component of jdk is used in java programming using “appletviewer” command.

Java Documentation – Java documentation is automatically generates documentation from source code. It is need for java program in easy maintenance of program code. Java documentation component of jdk is used in java programming using “javadoc” command.

Java Header File Generator – Java header file generator is used to produce the header file with implement native methods. Java header file generator component of jdk is used in java programming using “javah” command.

Java Disassembler – Java disassembler is used to enables us to convert bytecode files into a program description. In other word, It is used to disassemble java class file. Java disassembler component of jdk is used in java programming using “javap” command.

Java Debugger – Java debugger is check our program and find error in our program. Java debugger debug the java file. Java debugger component of jdk is used in java programming using “jdb” command.

Tuesday, 26 May 2015

Basic Concept Of Object-Oriented Programming In C++

By With No comments:

Object-oriented programming(oop) is simply a manner of thinking about the problem space of the system to be develped.
These Includes :

Object 


Object is the basic runtime entities in object oriented programming.They are also represent real world entity such as a perseon, a place, a bank acount, a table of data and any of the item that handle by program.
Object containing information about data and code to manipulate the data.Object can intract without having to know the details of each others code of block that exist in the class.

Class 


Class is a blueprint of related data members and methods.In other words, class is the self contained independent collection of the data member and methods, which create because perform specific task.
Once class has been defined, we can create any number of object of that class. A class is the collection of similar types of objects. Each object in class are associated with class.For example, fruite is define as a class and members of fruite class are mango, apple, and orange.

Data Abstraction And Encapsulation 


The wrapping up of data and functions into a  single unit is known as encapsulation. In the data encaptulation in data is not accessible to outside world and only those functions which are wrapped the class can access it.
This insulation of data from direct access by the program is called data abstraction or data hiding.
Abstarction is process of representing essential features without including the background details. 

Inheritance 


Inheritance is the process of which objects of one class acquires the properties of objects of another class.
Inheritance supports the concept of  hierachical classification.
Inheritance in we can add addition features to an existing class without modified it.

Polymorphism 


Polymorphism is the greek language word it means ability to take more than one form. In Polymorphism operations may exhibit different behavior is different instances. The behavior depends upon the types of data used in the operations.

Thursday, 30 April 2015

Structure Of C Programs

By With No comments:
 All the C Program are divided into many parts such as :
        Preprocessor Commands
        Functions
        Variables
        Statements and Expressions
        Comments

Preprocessor Commands :-

           Preprocessor Command is not a part of the compiler of c language but it is a diffrent step in the compilation time. All preprocessor commands starts with a (#) symbol.

Example :-

#define               Substitutes a preprocessor macro      
#include             Inserts a particular header from another file  
#undef                Undefines a preprocessor macro        
#ifdef                  Returns true if this macro is defined     
#ifndef                Returns true if this macro is not defined
#if                       Tests if a compile time condition is true
#else                    The alternative for #if
#elif                     #else an #if in one statement
#endif                  Ends preprocessor conditional
#error                  Prints error message on stderr
#pragma              Issues special commands to the compiler, using a standardized method

Main() Function :-

                we all know why main  function is used in c programs because when we run the program at that time program execution start with the main Function.

Syntax :-

int main()
{
// code write here
return 0;
}

Comments :-

         Comments are the statements that are ignored by the  compiler.

Syntax :-
                Multiline Comments :-
                /*    
                                  Comments statement that put here
                */
                Singleline Comments :-
                //     Comment statement put here for single line comments


Example of Hello World Program :-

#include<stdio.h>            //Preprocessor Commands
int main()                         //main()   program execution start to here
{
/* hello word program in c    */         //comments statements
printf(“Hello World…..\n”);    
return 0;                      

}

Wednesday, 29 April 2015

Introduction Of PL/SQL

By With No comments:
PL/SQL is programming language was developed by Oracle Corporation in the late 1980s. PL/SQL stands for procedural language extension of SQL. PL/SQL is a combination of SQL along with the procedural features of programming languages.

You can use PL/SQL to implement your bussiness rules by creating stored function, procdures and triggers or you can add programming logic to the SQL commands. PL/SQL have a one of the most important functionality to display multiple records from the multiple tables at the same time. In short PL/SQL is a completely portable, high-performance transaction-processing language.

Advantages Of PL/SQL :-

It is provide high security level.
It provide support for OOP(Object Oriented Programming).
It provide block structure.
It provides Exception Handling.
Better Performance
Platform Independent
Reduce the network traffic.


Friday, 24 April 2015

Introduction Of Asp.Net

By With No comments:
Asp stand for Active Server Pages was introduced in 1998 as Microsoft's first server side scripting. Asp.Net is provide the web-application development environment.

Asp.Net is the part of the Microsoft's .Net technology. ASP.NET has better language support, a large set of user controls, XML-based components, and integrated user authentication. ASP.NET pages have the extension .aspx, and It's code file extension is .aspx.cs.

When a browser requests an ASP.NET file, the ASP.NET engine reads the file, compiles and executes the scripts in the file, and returns the result to the browser as plain HTML(Hyper Text Markup Language). ASP.NET is a server-side technology.

Advantages of Asp.Net :-
  • Support for compiled languages.
  • Graphical development environment.
  • Updates files when server is running.
  • Reduce the amount the code.
  • Separation of code from html.
  • State management.
  • XML based configuration files.
  • Provide Authentication.  




Friday, 17 April 2015

Introduction Of Python

By With No comments:
Python is a high-level, interpreted, interactive and object-oriented scripting language. Python was developed by Guido van Rossum at the National Research Institute for Mathematics and Computer Science in the Netherlands. Python can easily integrated with C, C++, Java and etc.

Features Of Python :-
  • Easy to learn and read
  • Easy to maintain
  • Portable
  • Extendable
  • Database Support 
  • Graphical User Interface provide
  • Scalable
  • Reduce code length in python 
  • Interactive Mode
  • It provide automatic garbage collection.
  • It supports functional, structured and object-oriented programming method.

What is Python :-
  • Object-oriented language
  • Open-source
  • Interpreted language
  • simple and easy grammar
  • It is also support dynamic data types
  • Independents from platforms
  • Automatic memory management

Wednesday, 15 April 2015

Introduction Of Javascript

By With No comments:
Javascript is a scripting language. Scripting language is a kind of programming language with less functionality.We can use Javascript with HTML[Hyper Text Markup Language] webpages. Javascript was orignally need live script was developed by netscape.

Javascript is :-
  • Javascript is a light-weight, interprinted programming language with object oriented capabilities that allow you to build interactive into static html page.
  • Open and cross platform.
  • Design for creating network application.
Javascript can be divided into three parts :-
  1. The Core :-                                                                                                                             Javascript core part is least of language including operators,expression, statements and sub-programs.                                                                                                                                                     
  2.  The Client Side :-                                                                                                                      Client side javascript is a collection of objects that supports control of  browser and interaction  with users.                                                                                                                                                                                                                                         
  3. The Server Side :-                                                                                                                         Server side javascript is a collection of objects that make language useful  on a web server to    support communication with a DBMS[Database Management System].                                                                                                                                                                                                   





Saturday, 11 April 2015

Introduction Of Java

By With No comments:
Java was created by a team of programmers at sun microsystems of U.S.A in 1991.Java was initially called "Oak" by james Gosling but renamed "Java" in 1995. When the World Wide Web become popular in 1994, Sun realized that java was the perfect programming language for the web.

Java is high level, robust, secured, programming language and platform that :
  • Object-Oriented language
  • Fully network supported
  • Fully Graphical User Interface[GUI] 
  • Platform Independent
  • Executes stand-alone or on-demand in web-browser as applets
Features Of Java :-
  • Simple
  • Secure
  • Portable
  • Object-Oriented
  • Robust
  • Multithreaded
  • Interpreter
  • High Performance
  • Distributed
  • Dynamic
Where Java Language is Uses :-
In today's world in many fields spans the java such as :-
  • Desktop Applications
  • Web Applications 
  • Mobile Applications
  • Embedded System
  • Smart Cards
  • Robotics
  • Enterprise Applications
  • Games etc..

Introduction Of C++

By With No comments:
C++ is an object-oriented, case-sensitive, general purpose, free-form programming language that support the functionality of procedural and generic programming language. It was developed by Bjarne Stroustrup at AT&T Bell Laboratories in Murray Hill, New Jersey, USA, in the early 1980's. The idea of C++ comes from the C increment operator ++, thereby suggesting that C++ is an incremented version of C language.C++ is the object-oriented programming language.

Where C++ is Used :-

we can create this type of application in c++ some of them are as follows :
  • System Programming [e.g. Operating System and Embedded System]
  • Desktop Applications and Servers [e.g. E-Commerce, Web Search and Sql Server etc.]
  • Performance Critical Applications [e.g. Telephone Switches and Space Probes]
  • Entertainment Software
  • Object-Oriented Database
  • Real-Time System
  • AI And Expert System
Basic Concept Of Object-Oriented Programming :-
  • Objects 
  • Classes 
  • Data Abstraction and Encapsulation
  • Inheritance
  • Polymorphism
  • Dynamic Binding 
  • Message Passing  


Introduction Of C

By With No comments:
The C programming language is a general-purpose, high-level language that was developed by Dennis M. Ritchie in early 1970s. C is an procedural programming language.First we get some information about the procedure programming. Procedural programming uses a list of instruction to tell the computer what to do step-by-step. Procedure programming language are also known as top-down language or imperative language.

The c language now become a widely used professional and most popular language because it's some reasons such as:
  • Structured Language.
  • Easy to use and learn.
  • Provide efficiency in the program.
  • It can handle low-level activities.
  • It provide memory allocation.
  • It creates fast and efficient executable files.             
Which Purpose To Use C Language :-

Some example of the use of c language might be:
  • Operating Systems
  • Language Compilers 
  • Assemblers
  • Text Editors
  • Print Spoolers
  • Network Drivers
  • Database 
  • Language Interpreters
  • Modern Programs