Pages


Welcomes you for the new dimension of career

Welcome for the new dimension of your academic, personal as well as career exposure. I am very glad to be a part of your each and every enthusiastic and energetic step towards your career. I request all the students of various discipline to watch it whenever you have time and give us your valuable feedback. I, on behalf of KSRCE, wish you to share your innovative creation of ideas or knowledge and do healthy discussion about it. The topic may be about bioinformatics, networking, data mining, career choices, Higher studies in abroad, Research, Placement activity, ... and so on.I request you for posting and the healthy discussion on any career oriented topic.
Some inspirational quotes for your life are

"Education is not preparation for life; education is life itself".
"The object of education is to prepare the young to educate themselves throughout their lives".
“Life is relationship"
"Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover."

Please mail at it.career.solution2010@gmail.com for posting new topic. - Adhithan.S.V.

Tuesday, July 27, 2010

Mr. M.Vijaya Kumar Sr Lect - Java Interview Questions

For interview purpose, Sr Lecturer Mr. VijayaKumar posted this questions for you students.

What will be the default values of all the elements of an array defined as an instance variable?
If the array is an array of primitive types, then all the elements of the array will be initialized to the default value corresponding to that primitive type. e.g. All the elements of an array of int will be initialized to 0, while that of boolean type will be initialized to false. Whereas if the array is an array of references (of any type), all the elements will be initialized to null.
What will be the output of the following statement? System.out.println ("1" + 3);
It will print 13.
Can main method be declared final?
Yes, the main method can be declared final, in addition to being public static.
Can a public class MyClass be defined in a source file named YourClass.java?
No the source file name, if it contains a public class, must be the same as the public class name itself with a .java extension.
How many objects are created in the following piece of code? MyClass c1, c2, c3; c1 = new MyClass (); c3 = new MyClass ();
Only 2 objects are created, c1 and c3. The reference c2 is only declared and not initialized.
What is the default value of the local variables?
The local variables are not initialized to any default value, neither primitives nor object references. If you try to use these variables without initializing them explicitly, the java compiler will not compile the code. It will complain abt the local varaible not being initilized..
What are the different scopes for Java variables?
The scope of a Java variable is determined by the context in which the variable is declared. Thus a java variable can have one of the three scopes at any given point in time.
1. Instance : - These are typical object level variables, they are initialized to default values at the time of creation of object, and remain accessible as long as the object accessible.
2. Local : - These are the variables that are defined within a method. They remain accessbile only during the course of method excecution. When the method finishes execution, these variables fall out of scope.
3. Static: - These are the class level variables. They are initialized when the class is loaded in JVM for the first time and remain there as long as the class remains loaded. They are not tied to any particular object instance.

No comments: