Java Interview Question And Answer | Java Interview Question And Answer For Fresher | Core Java Interview Question And Answare | Set 11

1.What is serialization ?  Ans: Serialization is the process of writing complete state of java object into output stream, that stream can be file or byte array or stream associated with TCP/IP socket. 2.What does the Serializable interface do ?  Ans: Serializable is a tagging interface; it prescribes no methods. It serves to assign the Serializable data type to the tagged class and to identify the class as one which the developer has designed for persistence. ObjectOutputStream serializes only those objects which implement this interface. 3.How do I serialize an object to a file ?  Ans: To serialize an object into a stream perform the following actions:           1. Open one of the output streams, for example FileOutputStream.          ...

Java Interview Question And Answer | Java Interview Question And Answer For Fresher | Core Java Interview Question And Answare | Set 10

1.What methods java providing for Thread communications ?  Ans: Java provides three methods that threads can use to communicate with each other: wait, notify, and notifyAll. 2.Can Java object be locked down for exclusive use by a given thread?  Ans: Yes. You can lock an object by putting it in a "synchronized" block. The locked object is inaccessible to any thread other than the one that explicitly claimed it. 3.Can each Java object keep track of all the threads that want to exclusively access to it?  Ans: Yes. Use Thread.currentThread() method to track the accessing thread. 4.Does it matter in what order catch statements for FileNotFoundException and IOExceptipon are written?  Ans: Yes, it does. The FileNoFoundException is inherited from the IOException. Exception's...

Java Interview Question And Answer | Java Interview Question And Answer For Fresher | Core Java Interview Question And Answare | Set 09

1.What is a static method?  Ans: A static method is a method that belongs to the class rather than any object of the class and doesn't apply to an object or even require that any objects of the class have been instantiated. 2.What is a protected method?  Ans: A protected method is a method that can be accessed by any method in its package and inherited by any subclass of its class. 3.What is the difference between a static and a non-static inner class?  Ans: A non-static inner class may have object instances that are associated with instances of the class's outer class. A static inner class does not have any object instances. 4.What is the purpose of the System class?  Ans: The purpose of the System class is to provide access to system resources. 5.What is...

PHP Interview Question And Answare | PHP Interview Question And Answare for Fresher | Set 08

1.What is the functionality of MD5 function in PHP?  Ans: string md5(string) .It calculates the MD5 hash of a string. The hash is a 32-character hexadecimal number. 2.Will comparison of string “10″ and integer 11 work in PHP?  Ans: Yes, internally PHP will cast everything to the integer type, so numbers 10 and 11 will be compared. 3.What’s the difference between accessing a class method via -> and via ::?  Ans: :: is allowed to access methods that can perform static operations, i.e. those, which do not require object initialization. 4.How can I load data from a text file into a table?  Ans: The MySQL provides a LOAD DATA INFILE command. You can load data from a file. Great tool but you need to make sure that:          ...

PHP Interview Question And Answare | PHP Interview Question And Answare for Fresher | Set 07

1.How can we destroy the session, how can we unset the variable of a session?  Ans: session_unregister — Unregister a global variable from the current session          session_unset — Free all session variables     2.How can we destroy the cookie?  Ans: Set the cookie in past.     3.How many ways we can pass the variable through the navigation between the pages?  Ans: GET/QueryString           POST 4.What is the difference between ereg_replace() and eregi_replace()?  Ans: eregi_replace() function is identical to ereg_replace() except that this ignores case distinction when matching alphabetic characters.eregi_replace() function is identical...

PHP Interview Question And Answare | PHP Interview Question And Answare for Fresher | Set 06

1.What is the difference between the functions unlink and unset?  Ans: unlink() deletes the given file from the file system.          unset() makes a variable undefined.   2.How can we register the variables into a session?  Ans: $_SESSION[’name’] = “Mizan”;    3.How can we get the properties (size, type, width, height) of an image using PHP image functions?  Ans: 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...

PHP Interview Question And Answare | PHP Interview Question And Answare for Fresher | Set 05

1.How can we find the number of rows in a table using MySQL?  Ans: Use this for mysql         >SELECT COUNT(*) FROM table_name;     2.How can we find the number of rows in a result set using PHP?  Ans: $result = mysql_query($sql, $db_link);           $num_rows = mysql_num_rows($result);           echo "$num_rows rows found";    3.How many ways we can we find the current date using MySQL? Ans: SELECT CURDATE();          CURRENT_DATE() = CURDATE()          for time use          SELECT CURTIME();       ...

PHP Interview Question And Answare | PHP Interview Question And Answare for Fresher | Set 04

1.How can we know the number of days between two given dates using MySQL?  Ans: Use DATEDIFF()         SELECT DATEDIFF(NOW(),'2006-07-01'); 2.How can we change the name of a column of a table?  Ans: This will change the name of column:          ALTER TABLE table_name CHANGE old_colm_name new_colm_name 3.What is the functionality of the function strstr and stristr?  Ans: 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. 4.What is the difference between...

PHP Interview Question And Answare | PHP Interview Question And Answare for Fresher | Set 03

1.What is the use of obj_start()?  Ans: Its initializing the object buffer, so that the whole page will be first parsed (instead of parsing in parts and thrown to browser gradually) and stored in output buffer so that after complete page is executed, it is thrown to the browser once at a time. 2.Difference between mysql_connect and mysql_pconnect?  Ans: There is a good page in the php manual on the subject, in short mysql_pconnect() makes a persistent connection to the database which means a SQL link that do not close when the execution of your script ends. mysql_connect()provides only for the databasenewconnection while using mysql_pconnect , the function would first try to find a (persistent) link that's already open with the same  host, username and password. If one is...

PHP Interview Question And Answare | PHP Interview Question And Answare for Fresher | Set 02

1.How many ways we can pass the variable through the navigation between the pages?  Ans: At least 3 ways:          1. Put the variable into session in the first page, and get it back from session in the next page.          2. Put the variable into cookie in the first page, and get it back from the cookie in the next page.          3. Put the variable into a hidden form field, and get it back from the form in the next page. 2.What’s the difference between md5(), crc32() and sha1() crypto on PHP?  Ans: The major difference is the length of the hash generated. CRC32 is, evidently, 32 bits, while sha1() returns a 128 bit value, and md5() returns a 160 bit value....

PHP Interview Question And Answare | PHP Interview Question And Answare for Fresher | Set 01

1.What's PHP ?  Ans: The PHP Hypertext Preprocessor is a programming language that allows web developers to create dynamic content that interacts with databases. PHP is basically used for developing web based software applications. 2.What Is a Session?  Ans: A session is a logical object created by the PHP engine to allow you to preserve data across subsequent HTTP requests.         There is only one session object available to your PHP scripts at any time. Data saved to the session by a script can be retrieved by the same script or another script when requested from the same visitor.         Sessions are commonly used to store temporary data to allow multiple PHP pages to offer a complete functional transaction...

Java Interview Question And Answer | Java Interview Question And Answer For Fresher | Core Java Interview Question And Answare | Set 08

1.What is the purpose of a statement block?  Ans: A statement block is used to organize a sequence of statements as a single statement group 2.What is a Java package and how is it used?  Ans: A Java package is a naming context for classes and interfaces. A package is used to create a separate name space for groups of classes and interfaces. Packages are also used to organize related classes and interfaces into a single API unit and to control accessibility to these classes and interfaces. 3.What modifiers may be used with a top-level class?  Ans: A top-level class may be public, abstract, or final. 4.What are wrapped classes?  Ans: Wrapped classes are classes that allow primitive types to be accessed as objects. 5.Describe the wrapper classes in Java ?  Ans:...

Java Interview Question And Answer | Java Interview Question And Answer For Fresher | Core Java Interview Question And Answare | Set 07

1.What is the purpose of declaring a variable as final?  Ans: A final variable's value can't be changed. final variables should be initialized before using them. 2.What is the impact of declaring a method as final?  Ans: A method declared as final can't be overridden. A sub-class can't have the same method signature with a different implementation. 3.I don't want my class to be inherited by any other class. What should i do?  Ans: You should declared your class as final. But you can't define your class as final, if it is an abstract class. A class declared as final can't be extended by any other class. 4.What is finalize() method?  Ans: finalize () method is used just before an object is destroyed and can be called just prior to garbage collection. 5.What are Transient...

Java Interview Question And Answer | Java Interview Question And Answer For Fresher | Core Java Interview Question And Answare | Set 06

1.What is the argument of main() method?  Ans: main() method accepts an array of String object as argument. 2.Can a main() method be overloaded?  Ans: Yes. You can have any number of main() methods with different method signature and implementation in the class. 3.Can a main() method be declared final?  Ans: Yes. Any inheriting class will not be able to have it's own default main() method. 4.Does the order of public and static declaration matter in main() method?  Ans: No. It doesn't matter but void should always come before main(). 5.What are the static fields & static Methods ?  Ans: If a field or method defined as a static, there is only one copy for entire class, rather than one copy for each instance of class. static method cannot access non-static field...

Page 1 of 2912345Next

 
Design by Wordpress Theme | Bloggerized by Free Blogger Templates | coupon codes