Pages

Friday, June 29, 2012

JDBC insert using prerpared statement

Normal 0 false false false EN-US X-NONE X-NONE ...
Read more

JDBC Connection code to retrieve data from database

Normal 0 false false false EN-US X-NONE X-NONE ...
Read more

Sorting Algorithm in java

This program will sort the given number in array.import java.util.*;import java.lang.*;public class sort{public static void main(String args[]){int a[]={2,3,1,5,4};for(int i=0;i<5;i++){ for(int j=i;j<5;j++) { if(a[i]>a[j]) { int temp; temp=a[i]; a[i]=a[j]; a[j]=temp; } }System.out.print(" " + a[i]);...
Read more

Wednesday, June 20, 2012

Core Java interview questions top 100 - part 5

----------------------------------------------------CORE JAVA----------------------------------------------------81. What is the range of the char type?The range of the char type is 0 to 216 - 1 (i.e. 0 to 65535.)82. What is the range of the short type?The range of the short type is -(215) to 215 - 1. (i.e. -32,768 to 32,767)83. Why isn't there operator overloading?Because C++ has proven by example that operator overloading makes code almost impossible to...
Read more

Core Java interview questions top 100 - part 4

----------------------------------------------------CORE JAVA----------------------------------------------------61. What value does read() return when it has reached the end of a file?The read() method returns -1 when it has reached the end of a file.62. Can a Byte object be cast to a double value?No, an object cannot be cast to a primitive value.63. What is the difference between a static and a non-static inner class?A non-static inner class may have object...
Read more

Core Java interview questions top 100 - part 3

----------------------------------------------------CORE JAVA----------------------------------------------------41. What is use of a abstract variable?Variables can't be declared as abstract. only classes and methods can be declared as abstract.42. Can you create an object of an abstract class?Not possible. Abstract classes can't be instantiated.43. Can a abstract class be defined without any abstract methods?Yes it's possible. This is basically to avoid...
Read more

Core Java interview questions top 100 - part 2

 ----------------------------------------------------CORE JAVA----------------------------------------------------21. Does the order of public and static declaration matter in main() method?No. It doesn't matter but void should always come before main().22. Can a source file contain more than one class declaration?Yes a single source file can contain any number of Class declarations but only one of the class can be declared as public.23. What is a package?Package...
Read more

Java interview questions top 100 - part 1

----------------------------------------------------CORE JAVA----------------------------------------------------1. What is the most important feature of Java?Java is a platform independent language.2. What do you mean by platform independence?Platform independence means that we can write and compile the java code in one platform (eg Windows) and can execute the class in any other supported platform eg (Linux,Solaris,etc).3. What is a JVM?JVM is Java Virtual...
Read more