RSS Subscribe

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 theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

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 theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

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 theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

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 theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Sunday, 17 July 2011

Types of Interviews

Panel Interview/Board Interview
Candidates are interviewed by two or more individuals. This process is commonly used by governments and large organizations. It is important to maintain eye contact with the person asking the question and give an answer with an example to support it. Always acknowledge the other interviewers' presence by making eye contact while answering rotating questions. Direct your attention at the beginning and end of your response to the person who asked you that question. The questions asked in the interview are often set out in advance. The board may already have decided which answers they will accept/prefer for the questions. Ignore note-taking by board members. Obtain employers' names prior to the interview and use them during the conversation.
 
One-On-One Interviews
Candidates are interviewed by one person. These interviews tend to be more informal, however, it always depends on the employer's style. The interviewer will often have a series of prepared questions, but may have some flexibility in their choices. It is important to maintain eye contact with the person interviewing you.
 
FRESHER OFF-CAMPUS & MEGA JOB FAIRS - 2011
Fresher MEGA Job Fair
Impromptu Interviews
This interview commonly occurs when employers are approached directly and tends to be very informal and unstructured. Applicants should be prepared at all times for on-the-spot interviews, especially in situations such as a job fair or a cold call. It is an ideal time for employers to ask the candidate some basic questions to determine whether he/she may be interested in formally interviewing the candidate.
 
Second Interviews or Follow-Up Interviews
Employers invite those applicants they are seriously considering as an employee following a screening or initial interview. These interviews are generally conducted by middle or senior management, together or separately. Applicants can expect more in-depth questions, and the employer will be expecting a greater level of preparation on the part of the candidate. Applicants should continue to research the employer following the first interview, and be prepared to use any information gained through the previous interview to their advantage.
 
Dinner Interviews
The interviews may be structured, informal, or socially situated, such as in a restaurant. Don't be the only one at the table to order an alcoholic drink, and if you have an alcoholic drink, stop at one. Decide what to eat quickly, some interviewers will ask you to order first (don't appear indecisive). Avoid potentially messy foods, such as spaghetti. Be prepared for the conversation to abruptly change from 'friendly chat' to direct interview questions, however, don't underestimate the value of casual discussion, some employers place a great value on it.
 
Telephone Interviews
Have a copy of your resume and any points you want to remember to say nearby. If you are on your home telephone, make sure that all roommates or family members are aware of the interview (avoids loud stereos, etc.). Speak a bit slower than usual. It is crucial that you convey your enthusiasm verbally, since the interviewer cannot see your face. If there are pauses, don't worry, the interviewer is likely just making some notes.
 
Group Interviews
Employers bringing several candidates together in a group situation to solve a problem are testing your ability to work in a team environment. They want to know how you will present information to other people, offer suggestions, relate to other ideas, and work to solve a problem. In short, they are testing your interpersonal skills. It is difficult to prepare for this type of interview except to remember what is being testing and to use the skills you have to be the best team player and/or leader you can be. Some employers will take you to meet the staff who would be your co-workers if hired. This is a very casual type of interview, but leaving a positive and friendly impression is no less critical.

Interview DOs and DON'Ts

Interview DOs
  • Dress appropriately for the industry; err on the side of being conservative to show you take the interview seriously. Your personal grooming and cleanliness should be impeccable.
  • Know the exact time and location of your interview; know how long it takes to get there, park, find a rest room to freshen up, etc.
  • Arrive early; 10 minutes prior to the interview start time.
  • Treat other people you encounter with courtesy and respect. Their opinions of you might be solicited during hiring decisions.
  • Offer a firm handshake, make eye contact, and have a friendly expression when you are greeted by your interviewer.
  • Listen to be sure you understand your interviewer's name and the correct pronunciation.
  • Even when your interviewer gives you a first and last name, address your interviewer by title (Ms., Mr., Dr.) and last name, until invited to do otherwise.
  • Maintain good eye contact during the interview.
  • Sit still in your seat; avoid fidgeting and slouching.
  • Respond to questions and back up your statements about yourself with specific examples whenever possible.
  • Ask for clarification if you don't understand a question.
  • Be thorough in your responses, while being concise in your wording.
  • Be honest and be yourself. Dishonesty gets discovered and is grounds for withdrawing job offers and for firing. You want a good match between yourself and your employer. If you get hired by acting like someone other than yourself, you and your employer will both be unhappy.
  • Treat the interview seriously and as though you are truly interested in the employer and the opportunity presented.
  • Exhibit a positive attitude. The interviewer is evaluating you as a potential co-worker. Behave like someone you would want to work with.
  • Have intelligent questions prepared to ask the interviewer. Having done your research about the employer in advance, ask questions which you did not find answered in your research.
  • Evaluate the interviewer and the organization s/he represents. An interview is a two-way street. Conduct yourself cordially and respectfully, while thinking critically about the way you are treated and the values and priorities of the organization.
  • Do expect to be treated appropriately. If you believe you were treated inappropriately or asked questions that were inappropriate or made you uncomfortable, discuss this with a Career Services advisor or the director.
  • Make sure you understand the employer's next step in the hiring process; know when and from whom you should expect to hear next. Know what action you are expected to take next, if any.
  • When the interviewer concludes the interview, offer a firm handshake and make eye contact. Depart gracefully.
  • After the interview, make notes right away so you don't forget critical details.
  • Write a thank-you letter to your interviewer promptly.
Interview DON'Ts
  • Don't make excuses. Take responsibility for your decisions and your actions.
  • Don't make negative comments about previous employers or professors (or others).
  • Don't falsify application materials or answers to interview questions.
  • Don't treat the interview casually, as if you are just shopping around or doing the interview for practice. This is an insult to the interviewer and to the organization.
  • Don't give the impression that you are only interested in an organization because of its geographic location.
  • Don't give the impression you are only interested in salary; don't ask about salary and benefits issues until the subject is brought up by your interviewer.
  • Don't act as though you would take any job or are desperate for employment.
  • Don't make the interviewer guess what type of work you are interested in; it is not the interviewer's job to act as a career advisor to you.
  • Don't be unprepared for typical interview questions. You may not be asked all of them in every interview, but being unprepared looks foolish.
  • A job search can be hard work and involve frustrations; don't exhibit frustrations or a negative attitude in an interview.
  • Don't go to extremes with your posture; don't slouch, and don't sit rigidly on the edge of your chair.
  • Don't assume that a female interviewer is "Mrs." or "Miss." Address her as "Ms." unless told otherwise. Her marital status is irrelevant to the purpose of the interview.
  • Don't chew gum or smell like smoke.
  • Don't allow your cell phone to sound during the interview. (If it does, apologize quickly and ignore it.) Don't take a cell phone call.
  • Don't take your parents, your pet (an assistance animal is not a pet in this circumstance), spouse, fiance, friends or enemies to an interview. If you are not grown up and independent enough to attend an interview alone, you're insufficiently grown up and independent for a job. (They can certainly visit your new city, at their own expense, but cannot attend your interview.)
Here are the keys to successful phone interviewing. Follow these simple rules and you should achieve success in this important phase of job-hunting.
* Do give accurate and detailed contact information in your cover letter so your interviewers can easily connect with you. 

* When in job-hunting mode, don't have a disproportionately silly or long greeting on your answering machine or voicemail. 

* Do ensure that household members understand the importance of phone messages in your job search. 

* Do know what job you are interviewing for. 

* Do practice, if possible. Have a friend call you to do a mock phone interview so you get the feel of being interviewed over the phone. 

* When being interviewed by phone, do make sure you are in a place where you can read notes, take notes, and concentrate. 

* If you cannot devote enough time to a phone interview, do suggest a specific alternate time to the recruiter. It's often best to be the one who calls back so you can be mentally prepared. 

* Do consider using a phone interview log. 

* Do consider keeping some notecards or an outline in front of you to remind yourself of key points you want to cover with the interviewer. You don't want your responses to sound scripted, but you don't want to fumble for important points either. Do also have your resume in front of you so you can remember highlights of your experience and accomplishments. 

* Do ensure that you can hear and are being clearly heard. 

* Do consider standing when being interviewed on the phone. Some experts say you'll sound more professional than if you're slouching in an easy chair. 

* Do consider dressing nicely for the phone interview. It may sound silly since the interviewer can't see you, but you really will project a more professional image if you're dressed for the part instead of wearing, for example, a ratty bathrobe. 

* Don't feel you have to fill in the silences. If you've completed a response, but the interviewer hasn't asked his or her next question, don't start babbling just to fill in airtime. Instead, ask a question of your own related to your last response. 

* Do create a strong finish to your phone interview with thoughtful questions. 

* Don't panic if you have special needs. If you are hearing-impaired, for example, phone interviews are still possible. 

* Don't snuffle, sneeze or cough. If you can't avoid these behaviors, say “excuse me.” 

* Don't chew gum or food, or drink anything noisy.

PHP Top Interview Questions and Answers

1. What are the differences between GET and POST methods in form submitting, give the case where we can use get and we can use post methods?
On the server side, the main difference between GET and POST is where the submitted is stored. The $_GET array stores data submitted by the GET method. The $_POST array stores data submitted by the POST method.
On the browser side, the difference is that data submitted by the GET method will be displayed in the browser’s address field. Data submitted by the POST method will not be displayed anywhere on the browser.
GET method is mostly used for submitting a small amount and less sensitive data. POST method is mostly used for submitting a large amount or sensitive data.
2. Who is the father of php and explain the changes in php versions?
Rasmus Lerdorf for version changes go to http://php.net/ Marco Tabini is the founder and publisher ofphp|architect.
3. How can we submit from without a submit button?
We can use a simple JavaScript code linked to an event trigger of any form field. In the JavaScript code, we can call the document.form.submit() function to submit the form. For example:
4. How many ways we can retrieve the date in result set of mysql Using php?
As individual objects so single record or as a set or arrays.
5. What is the difference between mysql_fetch_object and mysql_fetch_array?
MySQL fetch object will collect first single matching record where mysql_fetch_array will collect all matching records from the table in an array.
6. What is the difference between $message and $$message?
They are both variables. But $message is a variable with a fixed name. $$message is a variable who’s name is stored in $message. For example, if $message contains "var", $$message is the same as $var.
7. How can we extract string ‘abc.com ‘ from a string ‘http://info@a…’ using regular _expression of php?
We can use the preg_match() function with "/.*@(.*)$/" as the regular expression pattern. For example:preg_match("/.*@(.*)$/","http://info@abc.com",$data); echo $data[1];
8. How can we create a database using php and mysql?
PHP: mysql_create_db()
Mysql: create database;
9. What are the differences between require and include, include_once?
File will not be included more than once. If we want to include a file once only and further calling of the file will be ignored then we have to use the PHP function include_once(). This will prevent problems with function redefinitions, variable value reassignments, etc.
10. Can we use include ("abc.php") two times in a php page "makeit.php"?
Yes we can include..
11. What are the different tables present in mysql, which type of table is generated when we are creating a table in the following
syntax: create table employee(eno int(2),ename varchar(10)) ?
Total 5 types of tables we can create
1. MyISAM
2. Heap
3. Merge
4. InnoDB
5. ISAM
6. BDB
MyISAM is the default storage engine as of MySQL 3.23.
12. Functions in IMAP, POP3 AND LDAP?
Please visit:
http://fi2.php.net/imap
http://uk2.php.net/ldap
13. How can I execute a php script using command line?
Just run the PHP CLI (Command Line Interface) program and provide the PHP script file name as the command line argument. For example, "php myScript.php", assuming "php" is the command to invoke the CLI program.
Be aware that if your PHP script was written for the Web CGI interface, it may not execute properly in command line environment.
14. Suppose your ZEND engine supports the mode Then how can u configure your php ZEND engine to supportmode ?
If you change the line: short_open_tag = off in php.ini file. Then your php ZEND engine support only mode.
15. Shopping cart online validation i.e. how can we configure the paypals?
FRESHER OFF-CAMPUS & MEGA JOB FAIRS - 2011
Fresher MEGA Job Fair
16. What is meant by nl2br()?
nl2br — Inserts HTML line breaks before all newlines in a string string nl2br (string); Returns string with ”inserted before all newlines. For example: echo nl2br("god bless\n you") will output "god bless \n you" to your browser.
17. Draw the architecture of ZEND engine?
18. What are the current versions of apache, php, and mysql?
PHP: php5.1.2
MySQL: MySQL 5.1
Apache: Apache 2.1
19. What are the reasons for selecting lamp (Linux, apache, mysql, php) instead of combination of other software programs, servers and operating systems?
All of those are open source resource. Security of linux is very very more than windows. Apache is a better server that IIS both in functionality and security. Mysql is world most popular open source database. Php is more faster that asp or any other scripting language.
20. How can we encrypt and decrypt a data present in a mysql table using mysql?
AES_ENCRYPT () and AES_DECRYPT ()
21. How can we encrypt the username and password using php?
You can encrypt a password with the following Mysql>SET PASSWORD=PASSWORD("Password");
We can encode data using base64_encode($string) and can decode using base64_decode($string);
22. How many ways I can redirect a php page?
Here are the possible ways of php page redirection.
Using Java script:
'; echo 'window.location.href="'.$filename.'";'; echo ''; echo ''; echo ''; echo ''; } } redirect('http://maosjb.com'); ?>
Using php function:
Header("Location:http://maosjb.com ");
23. List out different arguments in php header function?
void header ( string string [, bool replace [, int http_response_code]])
24. What type of headers have to add in the mail function in which file a attached?
$boundary = '—–=' . md5( uniqid ( rand() ) );
$headers = "From: \"Me\"\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: multipart/mixed; boundary=\"$boundary\"";
25. What are the differences between public, private, protected, static, transient, final and volatile?
element Class Interface
Data field Method Constructor
modifier top level nested top level nested
(outer) (inner) (outer) (inner)
final yes yes no yes yes no no
private yes yes yes no yes no yes
protected yes yes yes no yes no yes
public yes yes yes yes yes yes yes
static yes yes no no yes no yes
transient yes no no no no no no
volatile yes no no no no no no
26. What are the different types of errors in php?
Three are three types of errors:
1. Notices: These are trivial, non-critical errors that PHP encounters while executing a script - for example, accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all - although, as you will see, you can change this default behaviour.
2. Warnings: These are more serious errors - for example, attempting to include() a file which does not exist. By default, these errors are displayed to the user, but they do not result in script termination.
3. Fatal errors: These are critical errors - for example, instantiating an object of a non-existent class, or calling a non-existent function. These errors cause the immediate termination of the script, and PHP's default behaviour is to display them to the user when they take place.
27. What is the functionality of the function strstr and stristr?
strstr() returns part of a given string from the first occurrence of a given substring to the end of the string. For example: strstr("user@example.com","@") will return "@example.com".
stristr() is idential to strstr() except that it is case insensitive.
28. What are the differences between PHP 3 and PHP 4 and PHP 5?
Go read the release notes at http://php.net.
29. How can we convert asp pages to php pages?
You can download asp2php front-end application from the site http://asp2php.naken.cc.
30. What is the functionality of the function htmlentities? Answer: htmlentities  Convert all applicable characters to HTML entities
This function is identical to htmlspecialchars() in all ways, except with htmlentities(), all characters which have HTML character entity equivalents are translated into these entities.
31. How can we get second of the current time using date function?
$second = date("s");
32. How can we convert the time zones using php?
33. What is meant by urlencode and urldocode?
urlencode() returns the URL encoded version of the given string. URL coding converts special characters into % signs followed by two hex digits. For example: urlencode("10.00%") will return "10%2E00%25?. URL encoded strings are safe to be used as part of URLs.
urldecode() returns the URL decoded version of the given string.
34. What is the difference between the functions unlink and unset?
unlink() deletes the given file from the file system.
unset() makes a variable undefined.
35. How can we register the variables into a session?
We can use the session_register ($ur_session_var) function.
36. How can we get the properties (size, type, width, height) of an image using php image functions?
To know the Image type use exif_imagetype () function
To know the Image size use getimagesize () function
To know the image width use imagesx () function
To know the image height use imagesy() function
37. How can we get the browser properties using php?
38. What is the maximum size of a file that can be uploaded using php and how can we change this?
You can change maximum size of a file set upload_max_filesize variable in php.ini file
39. How can we increase the execution time of a php script?
Set max_execution_time variable in php.ini file to your desired time in second.
40. How can we take a backup of a mysql table and how can we restore it.?
Answer: Create a full backup of your database: shell> mysqldump –tab=/path/to/some/dir –opt db_name Or: shell> mysqlhotcopy db_name /path/to/some/dir
The full backup file is just a set of SQL statements, so restoring it is very easy:
shell> mysql "."Executed";
mysql_close($link2);
53. List out the predefined classes in php?
Directory
stdClass
__PHP_Incomplete_Class
exception
php_user_filter
54. How can I make a script that can be bilanguage (supports Eglish, German)?
You can change charset variable in above line in the script to support bilanguage.

JAVA & J2EE Interview Questions and Answers

  1. What is the use of bin and lib in JDK?- Bin contains all tools such as javac, appletviewer, awt tool, etc., whereas lib contains API and all packages.
  2. What is casting?- Casting is used to convert the value of one type to another.
  3. What is final, finalize() and finally?- final : final keyword can be used for class, method and variables. A final class cannot be subclassed and it prevents other programmers from subclassing a secure class to invoke insecure methods. A final method can’t be overridden. A final variable can’t change from its initialized value. finalize() : finalize() method is used just before an object is destroyed and can be called just prior to garbage collection. finally : finally, a key word used in exception handling, creates a block of code that will be executed after a try/catch block has completed and before the code following the try/catch block. The finally block will execute whether or not an exception is thrown. For example, if a method opens a file upon exit, then you will not want the code that closes the file to be bypassed by the exception-handling mechanism. This finally keyword is designed to address this contingency.
  4. What is UNICODE?- Unicode is used for internal representation of characters and strings and it uses 16 bits to represent each other.
  5. What is Garbage Collection and how to call it explicitly?- When an object is no longer referred to by any variable, java automatically reclaims memory used by that object. This is known as garbage collection. System. gc() method may be used to call it explicitly.
  6. What is finalize() method?- finalize () method is used just before an object is destroyed and can be called just prior to garbage collection.
  7. What is the difference between String and String Buffer?- a) String objects are constants and immutable whereas StringBuffer objects are not. b) String class supports constant strings whereas StringBuffer class supports growable and modifiable strings.
  8. What is a package?- A package is a collection of classes and interfaces that provides a high-level layer of access protection and name space management.
  9. What is a reflection package?- java. lang. reflect package has the ability to analyze itself in runtime.
  10. What is the difference between Integer and int?- a) Integer is a class defined in the java. lang package, whereas int is a primitive data type defined in the Java language itself. Java does not automatically convert from one to the other. b) Integer can be used as an argument for a method that requires an object, whereas int can be used for calculations.
  11. What is a cloneable interface and how many methods does it contain?- It is not having any method because it is a TAGGED or MARKER interface.
FRESHER OFF-CAMPUS & MEGA JOB FAIRS - 2011
Fresher MEGA Job Fair
 Question: In the init(ServletConfig) method of Servlet life cycle, what method can be used to access the ServletConfig object ?
 ANS: getServletConfig()
 
 Question: ejbCreate() method of CMP bean returns
 ANS: null
 
 Question: Which of the following is correct syntax for an Abstract class ?
 abstract double area();
 
 Question: A JSP page is opened in a particular Session. A button is present in that JSP page onclick of which a new Window gets opened.
 ANS: The Session is valid in the new Window
 
 Question: A class can be converted to a thread by implementing the interface___________
 ANS: Runnable
 
 Question: What is the output of following block of program ?
 boolean var = false;
 if(var = true) {
    System.out.println("TRUE");
 } else {
    System.out.println("FALSE");
 }ANS: TRUE
 EXPLANATION: The code compiles and runs fine and the 'if' test succeeds because 'var' is set to 'true' (rather than tested for 'true') in the 'if' argument.
 
 Question: A Vector is declared as follows. What happens if the code tried to add 6 th element to this Vector
 new vector(5,10)
 ANS: The element will be successfully added and The Vector allocates space to accommodate up to 15 elements
 EXPLANATION: The 1 st argument in the constructor is the initial size of Vector and the 2 nd argument in the constructor is the growth in size (for each allocation) This Vector is created with 5 elements and when an extra element (6 th one) is tried to be added, the vector grows in size by 10.
 
 Question: Which is the data structure used to store sorted map elements ?
 ANS: TreeMap
 
 Question: Which of the following is true ?
 (a) Stateless session beans doesn't preserve any state across method calls
 (b) Stateful session beans can be accesses by multiple users at the same time
 ANS: (a)
 
 Question: Stateful Session beans contain
 (a) Home Interface
 (b) Remote Interface
 (c) Bean Class
 (d) All
 ANS: (d)
 
 
Question: What is transient variable?
Answer: Transient variable can't be serialize. For example if a variable is declared as transient in a Serializable class and the class is written to an ObjectStream, the value of the variable can't be written to the stream instead when the class is retrieved from the ObjectStream the value of the variable becomes null.
Question: Name the containers which uses Border Layout as their default layout?
Answer: Containers which uses Border Layout as their default are: window, Frame and Dialog classes.
    
Question: What do you understand by Synchronization?
Answer: Synchronization is a process of controlling the access of shared resources by the multiple threads in such a manner that only one thread can access one resource at a time. In non synchronized multithreaded application, it is possible for one thread to modify a shared object while another thread is in the process of using or updating the object's value. Synchronization prevents such type of data corruption.
E.g. Synchronizing a function:
public synchronized void Method1 () {
     // Appropriate method-related code.
}
E.g. Synchronizing a block of code inside a function:public myFunction (){
    synchronized (this) {
            // Synchronized code here.
         }
}
  
Question: What is Collection API?
Answer: The Collection API is a set of classes and interfaces that support operation on collections of objects. These classes and interfaces are more flexible, more powerful, and more regular than the vectors, arrays, and hashtables if effectively replaces.
Example of classes: HashSet, HashMap, ArrayList, LinkedList, TreeSet and TreeMap.
Example of interfaces: Collection, Set, List and Map.
  
Question: Is Iterator a Class or Interface? What is its use?
Answer: Iterator is an interface which is used to step through the elements of a Collection.
   
Question: What is similarities/difference between an Abstract class and Interface?
Answer:  Differences are as follows:
  • Interfaces provide a form of multiple inheritance. A class can extend only one other class.
  • Interfaces are limited to public methods and constants with no implementation. Abstract classes can have a partial implementation, protected parts, static methods, etc.
  • A Class may implement several interfaces. But in case of abstract class, a class may extend only one abstract class.
  • Interfaces are slow as it requires extra indirection to to find corresponding method in in the actual class. Abstract classes are fast. 
Similarities:
  • Neither Abstract classes or Interface can be instantiated.
      
Question: How to define an Abstract class?
Answer: A class containing abstract method is called Abstract class. An Abstract class can't be instantiated.
Example of Abstract class:
abstract class testAbstractClass {
    protected String myString;
    public String getMyString() {
        return myString;
        }
    public abstract string anyAbstractFunction();
}
     
Question: How to define an Interface?
Answer: In Java Interface defines the methods but does not implement them. Interface can include constants. A class that implements the interfaces is bound to implement all the methods defined in Interface.
Emaple of Interface:

public interface sampleInterface {
    public void functionOne();

    public long CONSTANT_ONE = 1000; 
}
   
Question: Explain the user defined Exceptions?
Answer: User defined Exceptions are the separate Exception classes defined by the user for specific purposed. An user defined can created by simply sub-classing it to the Exception class. This allows custom exceptions to be generated (using throw) and caught in the same way as normal exceptions. 
Example:
class myCustomException extends Exception {
     // The class simply has to exist to be an exception 
} 
  
Question: Explain the new Features of JDBC 2.0 Core API?
Answer: The JDBC 2.0 API includes the complete JDBC API, which includes both core and Optional Package API, and provides inductrial-strength database computing capabilities. 
New Features in JDBC 2.0 Core API:
  • Scrollable result sets- using new methods in the ResultSet interface allows programmatically move the to particular row or to a position relative to its current position
  • JDBC 2.0 Core API provides the Batch Updates functionality to the java applications.
  • Java applications can now use the ResultSet.updateXXX methods.
  • New data types - interfaces mapping the SQL3 data types
  • Custom  mapping of user-defined types (UTDs)
  • Miscellaneous features, including performance hints, the use of character streams, full precision for java.math.BigDecimal values, additional security, and support for time zones in date, time, and timestamp values. 
    
Question: Explain garbage collection?
Answer: Garbage collection is one of the most important feature of Java. Garbage collection is also called automatic memory management as JVM automatically removes the unused variables/objects (value is null) from the memory. User program cann't directly free the object from memory, instead it is the job of the garbage collector to automatically free the objects that are no longer referenced by a program. Every class inheritsfinalize() method from java.lang.Object, the finalize() method is called by garbage collector when it determines no more references to the object exists. In Java, it is good idea to explicitly assign null into a variable when no more in use. I Java on calling System.gc() and Runtime.gc(),  JVM tries to recycle the unused objects, but there is no guarantee when all the objects will garbage collected.
   
Question: How you can force the garbage collection?
Answer: Garbage collection automatic process and can't be forced.
 
Question: What is OOPS?
Answer: OOP is the common abbreviation for Object-Oriented Programming.
 
Question: Describe the principles of OOPS.
Answer: There are three main principals of oops which are called Polymorphism, Inheritance and Encapsulation.
 
Question: Explain the Encapsulation principle.
Answer: Encapsulation is a process of binding or wrapping the data and the codes that operates on the data into a single entity. This keeps the data safe from outside interface and misuse. One way to think about encapsulation is as a protective wrapper that prevents code and data from being arbitrarily accessed by other code defined outside the wrapper.
 
Question: Explain the Inheritance principle.
Answer: Inheritance is the process by which one object acquires the properties of another object.
 
Question: Explain the Polymorphism principle.
Answer: The meaning of Polymorphism is something like one name many forms. Polymorphism enables one entity to be used as as general category for different types of actions. The specific action is determined by the exact nature of the situation. The concept of polymorphism can be explained as "one interface, multiple methods".
 
Question: Explain the different forms of Polymorphism.
Answer: From a practical programming viewpoint, polymorphism exists in three distinct forms in Java:
  • Method overloading
  • Method overriding through inheritance
  • Method overriding through the Java interface

 
Question: What are Access Specifiers available in Java?
Answer: Access specifiers are keywords that determines the type of access to the member of a class. These are:
  • Public
  • Protected
  • Private
  • Defaults
 
Question: Describe the wrapper classes in Java.
Answer: Wrapper class is wrapper around a primitive data type. An instance of a wrapper class contains, or wraps, a primitive value of the corresponding type.
Following table lists the primitive types and the corresponding wrapper classes:
PrimitiveWrapper
boolean  java.lang.Boolean
byte  java.lang.Byte
char  java.lang.Character
double  java.lang.Double
float  java.lang.Float
int  java.lang.Integer
long  java.lang.Long
short  java.lang.Short
void  java.lang.Void

 
Question: Read the following program:
public class test {
public static void main(String [] args) {
    int x = 3;
    int y = 1;
   if (x = y)
     System.out.println("Not equal");
  else
    System.out.println("Equal");
 }
}
What is the result?
   A. The output is “Equal”
   B. The output in “Not Equal”
   C. An error at " if (x = y)" causes compilation to fall.
   D. The program executes but no output is show on console.
Answer: C

Question:
 what is the class variables ?
Answer: When we create a number of objects of the same class, then each object will share a common copy of variables. That means that there is only one copy per class, no matter how many objects are created from it. Class variables or static variables are declared with the static keyword in a class, but mind it that it should be declared outside outside a class. These variables are stored in static memory. Class variables are mostly used for constants, variable that never change its initial value. Static variables are always called by the class name. This variable is created when the program starts i.e. it is created before the instance is created of class by using new operator and gets destroyed when the programs stops. The scope of the class variable is same a instance variable. The class variable can be defined anywhere at class level with the keyword static. It initial value is same as instance variable. When the class variable is defined as int then it's initial value is by default zero, when declared boolean its default value is false and null for object references. Class variables are associated with the class, rather than with any object. 
Question: What is the difference between the instanceof and getclass, these two are same or not ?
Answer: instanceof is a operator, not a function while getClass is a method of java.lang.Object class. Consider a condition where we use
if(o.getClass().getName().equals("java.lang.Math")){ }
This method only checks if the classname we have passed is equal to java.lang.Math. The class java.lang.Math is loaded by the bootstrap ClassLoader. This class is an abstract class.This class loader is responsible for loading classes. Every Class object contains a reference to the ClassLoader that defines. getClass() method returns the runtime class of an object. It fetches the java instance of the given fully qualified type name. The code we have written is not necessary, because we should not compare getClass.getName(). The reason behind it is that if the two different class loaders load the same class but for the JVM, it will consider both classes as different classes so, we can't compare their names. It can only gives the implementing class but can't compare a interface, but instanceof operator can.
The instanceof operator compares an object to a specified type. We can use it to test if an object is an instance of a class, an instance of a subclass, or an instance of a class that implements a particular interface. We should try to use instanceof operator in place of getClass() method. Remember instanceof opeator and getClass are not same. Try this example, it will help you to better understand the difference between the two.
Interface one{
}

Class Two implements one {
}
Class Three implements one {
}

public class Test {
public static void main(String args[]) {
one test1 = new Two();
one test2 = new Three();
System.out.println(test1 instanceof one); //true
System.out.println(test2 instanceof one); //true
System.out.println(Test.getClass().equals(test2.getClass())); //false
}

Twitter Delicious Facebook Digg Stumbleupon Favorites More