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.

Friday, 15 November 2013

How php language execute?

php is a interpretend language

An interpreted language is a programming language that executes instructions directly, without previously compiling a program into machine-language instructions. The interpreter executes the program directly, translating each statement into machine code on the fly as required. Compiled language programs, on the other hand, must explicitly be entirely translated ("compiled") into a sequence of machine language instructions before they can be executed.

What is the difference between strstr() and stristr()?

strstr -- Find first occurrence of a string and get the string from that character

strstr() example

<?php
$mail = 'pass@examplem.com';
$domain = strstr($mail, '@');
echo $domain; // prints @examplem.com
?>

stristr -- Case-insensitive strstr()

stristr() example

<?php
$email = 'USER@EXAMPLE.com';
echo stristr($email, 'e');
// outputs ER@EXAMPLE.

What are the differences between split, implode and explode?



split() and explode() are aliases for one-another. implode() and join() are
aliases for each other. i believe the name was originally explode(), but
split() was chosen later to suit perl programmers.

Different between implode and explode in php?

Implode

Join array elements with a string


Example

implode() example

<?php

$array = array('lastname', 'email', 'phone');
$comma_separated = implode(",", $array);

echo $comma_separated; // lastname,email,phone

// Empty string when using an empty array:
var_dump(implode('hello', array())); // string(0) ""

?>

EXPLODE:

split string as array


<?php
// Example 1
$pizza  = "piece1 piece2 piece3 piece4 piece5 piece6";
$pieces = explode(" ", $pizza);
echo $pieces[0]; // piece1
echo $pieces[1]; // piece2

// Example 2
$data = "foo:*:1023:1000::/home/foo:/bin/sh";
list($user, $pass, $uid, $gid, $gecos, $home, $shell) = explode(":", $data);
echo $user; // foo
echo $pass; // *

?>

What is PEAR?

 PEAR is short for "PHP Extension and Application Repository" and is pronounced just like the fruit. The purpose of PEAR is to provide:

    A structured library of open-source code for PHP users
    A system for code distribution and package maintenance
    A standard style for code written in PHP, specified here
    The PHP Extension Community Library (PECL), see more below
    A web site, mailing lists and download mirrors to support the PHP/PEAR community

PEAR is a community-driven project governed by its developers. PEAR's governing bodies are subdivided into the PEAR Group, Collectives, and a President. PEAR's constitution (adopted in March 2007) defining these groups is documented here. The PEAR project was founded in 1999 by Stig S. Bakken and quite a lot of people have joined the project.
PEAR Mission Statement

PEAR's mission is to provide reusable components, lead innovation in PHP, provide best practices for PHP development and educate developers.
Structured Libraries and Applications of PHP Code

The code in PEAR is partitioned in "packages". Each package is a separate project with its own development team, version number, release cycle, documentation and a defined relation to other packages (including dependencies). Packages are distributed as gzipped tar files with a description file inside, and installed on your local system using the PEAR installer.

Packages may relate to each other through explicit dependencies, but there is no automatic dependency relationship between packages based on the package name. For example, "HTTP_Post" is by default independent of "HTTP". Dependencies between packages with similar names is not forbidden, and does happen. As an example,the "DB_DataObject" package depends on the "DB" package.

A style guide, the PEAR Coding Standards (short PCS), exists to ease collaboration between PEAR developers, to enforce quality, and to enforce a consistent visual appearance of all source code distributed as a PEAR package.
Code Distribution and Package Maintenance

All PEAR packages are registered in and downloaded from a central server at pear.php.net. Other third-party servers called "channels" also distribute packages that can be installed by the PEAR Installer, see the Channels list for more information. pear.php.net does not endorse the packages from these channels, and only provides support for packages distributed from pear.php.net.

Pear.php.net provides both a human-friendly (HTML) and machine-friendly (currently REST) interface to the packages available from pear.php.net. All communication occurs over the HTTP protocol. Other functions the pear.php.net site provides are:

    user account management (independent of the SVN server)
    package management
    release management

Packages are distributed as a gzipped tar file with an XML description file inside. The description file (package.xml) contains some information about the package, a list of files and their roles, and dependencies.
The PHP Extension Community Library (PECL)

PECL

PECL (pronounced "pickle") is a separate project that distributes PHP extensions (compiled code written in C, such as the PDO extension). PECL extensions are also distributed as packages and can be installed using the PEAR installer with the pecl command.

More information and all PECL packages can now be found on the PECL homepage.

What is PHP?

PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.

Thursday, 12 September 2013

West Bengal SSC Notified for Lower Division Clerk/ Assistant (Group-C) Recruitment Examination-2013


West Bengal Staff Selection Commission invited application for recruitment to the posts of Lower Division Clerk/ Assistant (Group-C) Recruitment Examination-2013. The candidates eligible for the posts can apply through prescribed format before 13 September 2013.
Important Dates
Closing Date for Submission of Application Form: 13 September 2013
Details of Posts
  • Name of Post: Lower Division Clerk/Assistant (Group C)
  • Number of Posts: 3050 Posts
Detailed Advertisement

Sunday, 8 September 2013

Codeigniter objective interview question and answers

1).Code Igniter is a _____

a).Object Oriented Concept b).PHP Library without Web Server c).Application Development Framework d).Content Management System

2).Which of the following is not true about CodeIgniter

a).It is light weight b).It is fast c).It uses MVC d).It uses Delphi Modelling Techniques

3).The separation of logic and presentation can be seen in which of the following?

a).MVC approach b).Simpleton approach c).Master/Slave Model d).Semaphore Model

4).The urls generated by CodeIgniter are search-engine friendly and clean because they use

a).Query String approach b).Segment based approach c).Keyword based approach d). SEO based approach

5).One way to remove the index.php file in CodeIgniter is by using a

a).MVC file b).root file c)..htaccess file d).settings file

6).Which of the following cannot be used to extend CodeIgniter System
a).Library b).Helper c).System Hooks d).Jar files

7).The reason why CodeIgniter does not use a template engine is because
a).To reduce codebase b).To improve performance c).To reduce core files d).To reduce system files

8).Query string URLs cannot be used in CodeIgniter
a).True b).False c).Can be used in the latest version d). None

9).example.com/class/function/ID. The first segment in this example represents
a).Controller class b).Controller variable c).Library class d).Library variable

10).example.com/class/function/ID. The second segment in this example represents
a).Controller class b).Controller Function c).Library class d).Library Function

11).If you want a url like this, example.com/index.php/products/view/email.codeigniter what should you do?
a).Use a controller called do codeigniter b).Disable query strings
c).Use URL Suffix d). All of the above

12).In the url example.com/index.php/blog/ what is the controller name?
a).example b).index c).blog d).None

13).You usually save your controller in which of the following folder?
a).application/system/controllers b).application/controllers c).application d).application/helper

14).Your custom controller should
a).extend the child controller b). extend the super class c). extend the super controller d). extend the parent controller

15).In this url, example.com/index.php/products/shoes/sandals/123, shoes is
a).function b).controller name c).first variable d).None

16).To load a default controller what should you do?
a).Give the default controller name b).Always inherit the parent controller
c).specify this in application/config/routes.php d).Add a setting to application/config.php

17).The second segment of the URI typically determines
a).Which controller should be called b).which function in the controller gets called. C).which system library to load d).All of the above

18).If your controller contains a function named _remap() which of the following is true?
a).It will always get called regardless of what the URI contains. b).It overrides the normal behavior in which the URI determines which function to call c).CodeIgniter permits user to override normal behaviour through the use of the _remap() function d). All of the above

19).CodeIgniter has which output class that takes care of sending your final rendered data to the web browser automatically.
a).View class b).Output class c).Controller Class d).Routing Class


20).Which of the following is a private function in codeigniter?
a)._utility b).Utility c).utility_private d).private_utility

21).If you want to use a constructor in any of the Controllers, which of the following is necessary to achieve this?
a).parent::__construct(); b).child::__construct(); c).parent::controller(); d).super::controller()

22).Which of the following is a reserved name and hence cannot be used to name the controller:
a).CI_Base b).index c).Default d).All

23).A ____ is a web page or a page fragment like a header, footer etc
a).Controller b).Hook c).Teaser d).View

24).Which of the following is NOT true about Views?
a).views can flexibly be embedded within other views b).view must be loaded by a controller
c).views can be called directly d).views may or may not contain html

25).In the following, $this->load->view(‘name’); what does ‘name ‘ stand for?
a).config parameter b).view name c).parent view name d).controller class name

26). Which of the following is designed to work with information in your database?
a).Controller b).Model c).Sql Query d).Library

27).If you have a model class like this:
1
2
3
4
5
6
class User_model extends CI_Model
{    function __construct()
    {
        parent::__construct();
    }
}
What will be the file name when this class is saved as a model?
a).User_model b).user_model c).user_Model d).User_Model

28).If a model is located in a sub-folder like, application/models/blog/queries.php what is the right way to load this model?
a).$this->load->model(‘queries’);
b).$this->load->model(‘model/blog/queries’);
c).$this->load->model(‘blog/queries’);
d).$this->load->model(‘application/models/blog/queries’);

29).If you have a model called “Admissions”, what is the right way to access a function within this model if the model is assigned to a different object name like ‘fubar’?
a). $this->load->model(‘Admissions’, ‘fubar’); $this->fubar->function();
b). $this->load->model(‘Admissions’, ‘fubar’); $this->Admissions->function();
c). $this->load->model(‘Admissions’, ‘fubar’); $this->admin->function();
d). $this->load->model(‘Admissions’, ”); $this->fubar->function();

30).If you want to auto load a model what will you do?
a).Load it then and there using $this->load->model()
b).Load it when the parent model loads
c).Add the model to application/config/autoload.php
d).Remove the model from application/config/autoload.php

31).When a model is loaded
a).it is connected automatically to your database.
b).it does NOT connect automatically to your database.
c).it connects to database if you have set the config file properly
d).it connects ONLY if persistent connection is enabled

32). In the following database connectivity settings for a model, which of the following config is invalid?
1
2
3
4
5
6
7
8
9
10
$config['hostname'] = "localhost";
$config['username'] = "myusername";
$config['password'] = "mypassword";
$config['database'] = "mydatabase";
$config['dbdriver'] = "mysql";
$config['dbprefix'] = "";
$config['pconnect'] = FALSE;
$config['db_debug'] = TRUE;
$config['shared_pool_size'] = '200M';
$this->load->model('Model_name', '', $config);
a).$config['hostname']
b).$config['username']
c).$config['pconnect']
d).$config['shared_pool_size']
Answers to the above questions:
1
2
3
4
5
6
7
8
9
10
C
D
A
B
C
D
B
B
A
B
11
12
13
14
15
16
17
18
19
20
C
C
B
D
A
C
A
D
B
A
21
22
23
24
25
26
27
28
29
30
A
D
D
C
B
B
B
C
A
C
31
32








B
D








Codeigniter Interview questions and answers part2

5. Explain Codeigniter File Structure.

When you download Codeigniter you will see the following folder structure :-•    application
o    cache
o    Config
o    Controllers
o    core
o    errors
o    helpers
o    hooks
o    language
o    libraries
o    logs
o    models
o    thirdparty
o    views


•    system
o    core
o    database
o    fonts
o    helpers
o    language
o    libraries


6. Explain Application Flow Chart in codeigniter.

Application flow chart from Codeigniter documentaion
1. The index.php serves as the front controller, initializing the base resources needed to run CodeIgniter.
2. The Router examines the HTTP request to determine what should be done with it.
3. If a cache file exists, it is sent directly to the browser, bypassing the normal system execution.
4. Security. Before the application controller is loaded, the HTTP request and any user submitted data is filtered for security.
5. The Controller loads the model, core libraries, helpers, and any other resources needed to process the specific request.
6. The finalized View is rendered then sent to the web browser to be seen. If caching is enabled, the view is cached first so that on subsequent requests it can be served.


 7. Explain MVC in Codeigniter.

Model–View–Controller (MVC) is an architecture that separates the representation of information from the user’s interaction with it.




cakephp mvc

Controller:- The Controller serves as an intermediary between the Model, the View. controller mediates input, converting it to commands for the model or view.
Model:-The Model represents your data structures. Typically your model classes will contain functions that help you retrieve, insert, and update information in your database.The model consists of application data and business rules.
View:-The View is the information that is being presented to a user. A View will normally be a web page.A view can be any output representation of data.
For more detail understanding MVC please read this article What is MVC(Model-View-Controller) Architecture.


8. What are the hooks in codeigniter.

CodeIgniter’s Hooks feature provides a means to tap into and modify the inner workings of the framework without hacking the core files.How ever you like to cause some action to take place at a particular stage in the execution process.
he hooks feature can be globally enabled/disabled by setting the following item in the application/config/config.php file:
$config['enable_hooks'] = TRUE;
Hooks are defined in application/config/hooks.php file.For example
view source
print?
1    $hook['pre_controller'] = array(
2    'class'    =&gt; 'MyClass',
3    'function' =&gt; 'Myfunction',
4    'filename' =&gt; 'Myclass.php',
5    'filepath' =&gt; 'hooks',
6    'params'   =&gt; array('test', 'test1', 'webs')
7    );


9. How you will add or load an model in codeigniter.

Models will typically be loaded and called from within your controller functions. To load a model you will use the following function:
view source
print?
1    $this->load->model('Model_name');

 
10. What are the helpers in codeigniter.

Helpers, as the name suggests, help you with tasks. Each helper file is simply a collection of functions in a particular category.There are URL Helpers, that assist in creating links, there are Form Helpers that help you create form elements, Text Helpers perform various text formatting routines, Cookie Helpers set and read cookies, File Helpers help you deal with files, etc.
Loading a helper file is quite simple using the following function:
view source
print?
1    $this->load->helper('name');

Codeigniter Interview question and answers part 1

1. What is codeigniter?

Codeigniter is open source , web application framework.Its is for building websites using php.Codeigniter is loosely based on MVC pattern.Most simple framework in php , which is you will easily learn.Its mostly known for its speed as compare to other frameworks in php.
 

Its goal is to enable you to develop projects much faster than you could if you were writing code from scratch, by providing a rich set of libraries for commonly needed tasks, as well as a simple interface and logical structure to access these libraries.

2. When and who developed codeigniter?
 The first public version of CodeIgniter was released on February 28, 2006.


3. What is current version of codeigniter?
 version 2.1.3 was released October 8, 2012.The development version of codeigniter 3.0-dev was release on October 20, 2011.Preview version 3.0-dev, is certified open source software licensed with the Open Software License.

4. What are the features of codeigniter.?

1. Codeigniter is free to use,its an open source framework.
2. Its light weight.The core system requires only a few very small libraries.Not like other frameworks that require heavy file libraries.
3. CodeIgniter is Fast.Its faster than any other framework in php.
4. The URLs generated by CodeIgniter are clean and search-engine friendly.You will change any url to what ever you want from files.
5. CodeIgniter is Extensible.The system can be easily extended through the use of your own libraries, helpers, or through class extensions or system hooks.
6. CodeIgniter Uses MVC(Model View Controller) which allows great separation between logic and presentation.
7. CodeIgniter requires nearly zero configuration,does not require you to use the command line,not forced to learn a templating language.
8. Full Featured database classes with support for several platforms,Security and XSS Filtering,Error Logging.

Wednesday, 10 July 2013

What is Cookies in php

Cookies


The state management object using to maintain the state of application Cookies stores the data in client memory location.
These data we can access from any web page within the application

Cookies stores the information in two location, Either Hard disk or Ram memory location of client system

Cookies are divided into Two types


1.In-memory cookies


If we create any cookie without explicit expiry tag comes under in memory cookies. In memory cookies stores the information
in clinet Ram memory location and destroys the data when user closed the browser


2.Persistence cookies


IF we create any cookies with explicit expiry tag
comes under persistence cookies . persistence cookies stores the data in Hard disk and delete the information when the lifetime
cookies complete

SET_cookies


By using this function we can create the cookies in php

$_COOKIES


By Using this global variable we can get the value of cookies.Cookies used in browser memory location that why we cannot access the cookies from one browse to another browser.


Example:
Page 1.php

<?php
set cookies('x',100);
echo "created cookies";
?>


page2.php

<?php
echo "value is ".$_COOKIE['x'];
?>


Steps to create persistence Cookies


1.Get the current date and time Information when user send the request to access the file where we created cookies.
2.Add lifetime to the current data and time to get expiry time.
3.Create cookies with that expiry tag.

Example:


<?php
set cookies('x',100);
Set cookies('y',1001,time()+1000);
echo $_COOKIES['x'];
echo $_COOKIES['y'];
?>


Persistence cookies will store in hard disk in a file of browser memory location
the name of that file is username@domain_name.

We can delete the cookies from client system by recreating the cookies with completed time.


Disadvantage of Cookies


1.Cookies stores the information in client system . that why client can delete the information or client can modify cookies data
2.cookies is storing limited amount of data
3.cookies can store only text data

Saturday, 6 July 2013

What is W3c?

What is W3c?


 It stands for world wide web consortium which is an international consortium of companies.it was founded in 1994 by Tim Bernese Lee.

W3c activities


1 W3c creates and maintains WWW standards.
2 W3c is working to standardize the web.
3.W3c standards are called w3c remonstrations.
4.W3c is organized to a number organization etc.

W3c numbers


There are the following well known numbers in w3c


1 IBM
2 microsoft
3.America online
4.Apple
5.Adobe
6.macromedia
7.sunmicrosystem etc

What is internet


 Internet stands for international network. it is the combination of two resource

1. Web resource
2. Network resource

1.Webresourec


It is collection of electric pages or e-pages,developed  and implement by tim berners lee.he is the father of web

2.Network Resource


Collection of hardware and software resource. implement and developed by klain rock is the father of network.

Types Of Errors In Php

Types of Errors in php


There are four types of errors

1.Notice
2.Warning
3.Fatal Error
4.Parse Error


1.Notice


It is nothing but a samll information to user. If we are trying to access undefined variable. The Output is Notice.Notice does'nt stop the execution.

Example:
<?php
$var1="car";
$var 2=3;
echo $var1'.'$var2;
echo $var3;// Notice error
  ?>

By default we cannot see the notice message on browser.Because , The configuration setting ie error_reporting value is "E_ALL" & ~E_NOICE , The notice are displayed by the Browser. we can also display notice within the program by using Error_Reporting(E_ALL).

Example:

<?php
error_reporting(E_ALL)
$var1="car";
$var 2=3;
echo $var1'.'$var2;
echo $var3;// Notice error
?>

2.Warning:


If is same as notice does not stop script execution.It occurs if we are tying to call undefine constant.
In php,we can declare constant by using define.

Example:

<?php
define("sno",10)
echo constant("sno");
echo constant("a");// undefined constant
?>

3.Fatal error:

It stop the execution of webpage from line where the error occurred. If we try to call undefined function.

Example:
<?php
 function f1()
{
echo "welcome  to www.online24by7.info";
}
f1():
f2();// undefined function
?>

4.Parse Error:

It stop the Exection of complete script if there is syntax error

Example

<?php
echo "line 1"
echo "hi"// does not contain semicolon 
?>

Tuesday, 21 May 2013

Pointer Arithmetic


All types of arithmetic operations are impossible with a pointer. The only valid operations that can be performed are as-


1. Addition of integer to a pointer and increment operations.

2. Subtraction of an integer from a pointer and decrement operations.

3. Subtraction of a pointer from another pointer of same type
pointer arithmetic is somewhat different from ordinary arithmetic. Here all arithmetic is performed relative to the size of basic type of pointer.

For example, 

If we have an integer pointer pi which contains address 1000, then on incrementing we get 1004 instead of 1001. This is because the size of Pointer is Four depends on architecture.

Rules of the pointer Arithmetic

Rule1.

Address+Number=Address (next address)
Address-Number=Address (pre address)
Address++=Address (next address)
Address--=Address (pre address)
++Address=Address (next address)
--Address=Address (pre address)

p1+p2;Error
p1+1;(next address)
p1++;(next address)
p1=p1+1;
++p1;(next address)
P2-p1;valid(number of element)
p2-1;valid
p2; valid
--p2;

Rule 2:

Addresss-Address=Number(number of elements)

Rule 3.

Address+Address=illegal
Address*Address=illegal
Address/Address=illegal
Address%Address-illegal

Rule4:

We can use relation operator and conditional operator between two pointers.
(<,>,<=,>=,==,!==)
Address>Address=true/false
Address>=Address=true/false


Rule 5:

We can't per from the bit wise between two pointers like
Address&Address=illegal
Address|Address=illegal
Address^Address=illegal
-Address=illegal

Rule6:

We can find size of a pointer using size of the operator.

Example of arithmetic pointers


#include<stdio.h>
main

{
static int arr[]={0,1,2,3,4};
int *p[]={arr,arr+1,arr+2,arr+3,arr+4};
int **ptr=p;
ptr++;
printf("\n%d%d%d,ptr-p,*ptr-arr,**ptr);
*ptr++;
printf("\n %d %d %d",ptr-p,*ptr-arr,**ptr);
*++ptr;
printf("\n %d %d %d",ptr-p,*ptr-arr,**ptr);
++*ptr;
printf("\n %d %d %d",ptr-p,*ptr-arr,**ptr);
}


Output:111
          222
          333
          344

Explanation

Let us consider the arr and the two pointers with the same address.

arr

arr_value        0       1      2        3         4    
arr_address   100   102    104    106      108


P

arr_address       100       102    104   106   108
pointer_address 1000    1002   1004  1006  1008

ptr

p_address  100
ptr_address 200

Ptr is incremented by ptr++ and has value 1002, Now ptr-p is (1002-1000)/(scaling factor)==1,*ptr-arr=(102-100)/(scaling factor)===1,**ptr=1.

Hence the output of the first print is 1,1,1.
*ptr++ becomes 1004. Hence the output for the ptr-p=2,*ptr-arr=2,**ptr=2.
*++ptr becomes 1004. Hence the output for the ptr-p=3,*ptr-arr=3,**ptr=3.
++*ptr increments ptr by the scaling factor. so the value in array p at location 1006 changes from 106 10 108.hence ,the outputs for ptr-p=1006-1000=3,*ptr-arr=108-100=4,**ptr=4.

Example2:

#include<stdio.h>
main()
{
char *str="xyz"
char *ptr=str;
char lest=127;
while(*ptr++)
least =(*ptr<leeast)?*ptr:least;
printf("%d", least);
}


Output 0

Explanation

When ptr reaches the end with the string, the value pointed by ptr is'\0' ,value of ptr is less the value of least. So the logical result of expression is zero. Hence least is zero.


Saturday, 11 May 2013

What Is Hungarian?


Hungarian notation:

It is one of the naming conventions followed by the sun micro system for naming predefined, class/interface/predefined methods and data methods.

Hungarian

Rule 1 for class and interface


"If any class name or interface name", is containing either one word or more than one word. All words first letter must be capital.
EX:


       Normal Notation
          
         Hungarian  Notation
  System
 Action event
Number formal exception array index out  of bounds exception.
  System
  Action event
 Number formal exception array index out of bounds exception.
          

Hungarian Rule 2 for the methods


If any method is containing either one word or more then one word, then one word first letter is small and rest of sub-sequence words first letter must be capital.
EX:

              Normal notation
         Hungarian  notation
  Print/n()
Action perform()
Item state change()
  Print/n()
Action perform()
Item state change()

Hungarian Rule 3 for the methods:

If we are using any predefined data members then all the data member must be  in capital letter.
 If the data member contains more than one word, than they be separated by underscore (-).

               Normal
Hungarian
  PI
MAX-PREORITY
SCROLLBARS-VERTICAL ONLY.
   PI
MAX-PREORITY
SCROLLBARS-VERTICAL ONLY.


The above rules are mandatory for predefined Class/Interface, method and data members.

The above rules are optional for user defined Class/Interfaces, method and data members. Software industry is always recommended to Java programmers apply the Huainan rules even for user defined class/interfaces, methods and data members.

Thursday, 9 May 2013

Difference Between Instance Data Member and Static Data Members

 Types of data members in Java:

We known that every single java program must be written with respect to class, and a class is containing a collection of data members and method. In Java program data members from the class are classified as two types. They are

  1.  Instance data member’s
   2.  static data members

           Instance data members
        Static data members
1. Instance's data members are those whose memory space is creating every single time,"when we create an object."
1. Static data members are those whose memory space is creating only once. When the class is a loader into main memory irrespective of the number of object are created.
2. If the data member of a class is taking a specific value, than we must take the data member as instance.
2. If the data member of a class is taking a specific value, "then we must take the data member as instance."
3. Programatically instance data members declaration should not be preceded by keyword static.
Syntax:-
    Data type V1, V2……….
3. Programmatically instance's  data members declaration should not be preceded by keyword static.
Syntax:
    Data type V1, V2……….
4. Every single instance data member must be access with the respective object name.

Objname.instance data member name
4. All the static data members in Java must be access with the respective class name.

Classname.static data member name
5. All the values of instance data members are not sharable.

5. All the values of static data members are sharable.
6. All the instance data members are known as object's  level data members, because they depend on object name and independent from class name.

EX:- Int PIN,STNO,
6. All the static data members are known as class's  level data members, because they depend on class and independent from object name.

Static string INDIACAP,crsname;

Tuesday, 7 May 2013

Difference Between Class and Object in Java?

Definition of class:- Class is a collection of data members and associated methods.

Definition of object:- Blue print of class is known as object

 

Different between class and object is follow


                    Class
                       Object
1.The process of binding the data member
 and associated methods. In a single unit
  is known as class.
1. Class variable is known as object.
2. Whenever we defined a class we never get any amount of memory space for the data members of class.
2. Whenever we create an object we get the memory space for the data member of a class.
3. Class will have logical existence.
3. Object will have physical existence.
4. Class will be loader first by class. Loader subsystem from secondary memory to primary memory.
4. After loading the class .In main memory object creation will taken place.




All the object of Java resides in heap memory (in general which ever languages follow dynamic memory location whose object resides in heap memory).

All the methods of all the programming languages executes in Stack memory.

All the constants values of all programming languages reside in Associative memory.

Heap memory, Stack memory and Associative memory are the parts of main memory.

Saturday, 4 May 2013

What Is Constructor in Java?

 A constructor is a special member method which will call by the JVM automatically whenever an object is created by placing over own values without placing the default value.

Advantages of constructors:


If we use the constructor concept add a part of over the java program, we get the following advantage.

1. It eliminates in placing default values.

2. It eliminates in calling ordinary method. The purpose of constructor concept is that it initialized  the object.

.

Properties/characteristic of constructor:


 In over the java program, if we want to make use of constructor, the java programmer must follow the rules.

1. Constructor will be called automatically are implicitly whenever an object is created.

2. Constructor name must be similar to class name.

3. Constructor will not return any value even void also (if we write any return type in java, which is by default treated as an ordinary method).

4. The modified of the constructor should not be static because constructor will be called each time as a when an object is created...

5. Constructor will not be inherited because each constructor of class must initialize its own data member.

6. A constructor of a class may are may not be private.

7. If the constructor is private than the object of corresponding class can’t be created within the context of some other class, but it can be possible to create it object only within the context scope of class.

8. If a constructor is not private than the corresponding class object can be created everywhere i.e. no restriction on the accessibility of the constructor.

Thursday, 2 May 2013

What Is Different Between Instant Methods and Static Methods?


Each and every class of java contains a collection of methods the methods of java are divided into two types. They are

1. Instance methods/non static methods.

2. Static methods.


                    Instant methods
                   Static methods
1. Instance methods are those, which are recommended to perform Repeated operations such as reading the records from the file, reading records from the data base.

1. Static methods are those, which are recommended to perform. One time operation such as obtaining connection from the data base opening the file either in read mode or write mode.
2. Pro-grammatically, instance methods definition should not be preceded by a keyword.

Static

 Syntax

  Return type method name(list of formal parameter)
{
      block of statements()
}

2. Pro-grammatically, static methods definition must be preceded by a keyword static.

Syntax

  Static return type method name(list of formal parameters)

{

     Block of statements()
}



3. Each and every instances method in java must be axis with respective to object name objname instance method name.

3. Each and every static method in java must be axis with respective to class name
Class name Static method name.

4. The result of instance is not sharable.

4. The result of static method is sharable.

5. Instance method is also known as object level methods because they depend on object name and independent form class name.

Example:

Void calfot()
{

   tot=m1+m2+M3;
}
5. Static methods are also known as class level method because they depend on class name and independent on object name.

Example:

Static void main(string arrays)
{

    S1,caltotal();
   S2.caltotal();
}


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



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.



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

Twitter Delicious Facebook Digg Stumbleupon Favorites More