Where local variables in Java Store?
Ans: Local variables store inside the Stack of JVM
All class instances and Arrays are allocates in Heap Memory.
Question : What is output of the below program?
Ans :
String s1 = "MY Name is Chakra";
String s2 = "MY Name is Chakra";
if(s2 == "MY Name is Chakra"){
System.out.println(" s1 == s2 ");
}else{
System.out.println(" s1 != s2 ");
}
if(s1.equals(s2)){
System.out.println(" s1 equals s2 ");
}else{
System.out.println(" s1 not equals s2");
}
o/p : s1 == s2
s1 equals s2
Question 2 :
String s1 = "MY Name";
s1 = s1 + " is Chakra";
String s2 = "MY Name is Chakra";
if(s1 == "MY Name is Chakra"){
System.out.println(" s1 == s2 ");
}else{
System.out.println(" s1 != s2 ");
}
o/p : s1 != s2
s1 equals s2
Question 3 :
String s1 = new String("MY Name is Chakra");
if(s1 == "MY Name is Chakra"){
System.out.println(" s1 == s2 ");
}else{
System.out.println(" s1 != s2 ");
}
o/p: s1 != s2
s1 equals s2
Question : What are the interfaces a string class implements?
Ans: Serializable , Comparable, charSequence.
Question : If your class overrides the hashCode method , how will you get the
int value of default hashCode() .
Ans : Use System.identityHashCode(obj1);
Question: how can you make your class immutable ?
Ans: Declare all variables as private, and do not provide setters and getters.
Hi, This blog is the place who want to prepare for programming interview with major product development companies. Apart from interview questions I would like to provide some concepts on the new technologies which I learn as part of my carrier. Thanks for visiting my Blog.
Wednesday, December 29, 2010
Thursday, December 16, 2010
MYSQL Interview Questions
What is the difference between RDBMS and DBMS?
Ans : 1)DBMS does not support a tabular structure and does not enforce relationship
betweeb tables.
2) DBMS does not enforce security on data manipulation Operations.
it does not ensure the ACID property.
Where as RDMS ensures all the above property.
Question : What is ACID Property in RDBMS?
Answer : from wikipedia :
Atomicity requires that database modifications must follow an "all or nothing" rule.
consistency property ensures that any transaction the database performs will
take it from one consistent state to another.
Isolation refers to the requirement that other operations cannot access data that
has been modified during a transaction that has not yet completed.
Durability is the ability of the DBMS to recover the committed transaction updates
against any kind of system failure (hardware or software).
This is Very Good Website for MYSQL Interview Questions :
http://dba.fyicenter.com/Interview-Questions/MySQL/
What is TableSpace ?
Ans : 1) It is a logical unit storage in Oracle Database.
2) consists of one or more data files.
3) can be taken into offline or online.
4) can make read Only.
Ans : 1)DBMS does not support a tabular structure and does not enforce relationship
betweeb tables.
2) DBMS does not enforce security on data manipulation Operations.
it does not ensure the ACID property.
Where as RDMS ensures all the above property.
Question : What is ACID Property in RDBMS?
Answer : from wikipedia :
Atomicity requires that database modifications must follow an "all or nothing" rule.
consistency property ensures that any transaction the database performs will
take it from one consistent state to another.
Isolation refers to the requirement that other operations cannot access data that
has been modified during a transaction that has not yet completed.
Durability is the ability of the DBMS to recover the committed transaction updates
against any kind of system failure (hardware or software).
This is Very Good Website for MYSQL Interview Questions :
http://dba.fyicenter.com/Interview-Questions/MySQL/
What is TableSpace ?
Ans : 1) It is a logical unit storage in Oracle Database.
2) consists of one or more data files.
3) can be taken into offline or online.
4) can make read Only.
Subscribe to:
Posts (Atom)
AWS certification question
AWS AWS Hi! this is for questions related to AWS questions. EC2 instances EC2 storage types cold HDD : 1. Defines performance in terms...
-
Here I am going to discuss some of the differences between Text and String class in Hadoop. Text class lies in the package: import org.ap...
-
Q: What is the library you used in spring to connect to database? Spring JDBC template. Q: What and all involved in fetching the data ...
-
There are 2 ways we can load data into the HIVE Tables. In this tutorial we are loading data into the HIVE managed Table. This is my sa...