|
INTERVIEW QUESTIONS
J2EE
JAVA
DETAILS
Question: whats the difference in data types of java and c++? 2)what is the use of finally block?? 3)what is encapsulation in oops?how is it achieved in Java?
Answer: The types supported by Java are the primitive data types, classes, interfaces, and arrays. C++ supports a variety of types, including primitive types, classes, structs, unions, and defined types. The C++ typedef construct does not have an analog in Java. C++ also supports enumerated data types, and Java does not. C++ is much more flexible in providing implicit casting between types. Java supports C++-style casting operators, but does not support implicit casting to the same extent as C++.
|
|
|
Category |
Java Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 7994 users |
Added on |
7/16/2011 |
Views |
70684 |
Rate it! |
|
|
Question:
whats the difference in data types of java and c++? 2)what is the use of finally block?? 3)what is encapsulation in oops?how is it achieved in Java?
Answer:
The types supported by Java are the primitive data types, classes, interfaces, and arrays. C++ supports a variety of types, including primitive types, classes, structs, unions, and defined types. The C++ typedef construct does not have an analog in Java. C++ also supports enumerated data types, and Java does not. C++ is much more flexible in providing implicit casting between types. Java supports C++-style casting operators, but does not support implicit casting to the same extent as C++. Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
In overriding, in super class we declared a method as protected & in sub class we declared that method as private. what happens?
|
View Answer
|
|
In overriding, the super class method throws I/O exception & in sub class that method throws arithmetic exception. what happens?
|
View Answer
|
|
How can we store elements in arraylist? as by using index or by node?
|
View Answer
|
|
Which is superclass of Exception?many people think that object,no there is particular class which is superclass of all exception it starts with letter B,plz tell me
|
View Answer
|
|
What happen if we write many curly braces in main method and write println method inside it .program will compile or not?
|
View Answer
|
|
How to track "memory leak" and how to prevent it in java?
|
- Java Interview Questions & Answers">
View Answer
|
|
What is serialization?What is transient?What is the default value of a transient variable?
|
View Answer
|
|
can we write return statement in try catch or finally block. suposse we write return 0 in try catch or finally. can we do.
|
View Answer
|
|
what is assert function what are the type how they are used with an example
|
View Answer
|
|
I want to know output of this program and the flow also
public class Aquestion { private int i = giveMeJ(); private int j = 10; private int giveMeJ() { return j; } public static void main(String args[]) { System.out.println((new Aquestion()).i); } }
|
View Answer
|
|
Scope Variables
|
View Answer
|
|
Can You catch the Error?
2. Difference between compiletime exception and runtime exception?
3. How you throw user defined exception?
4. How you handle throwable while using exceptions ?
5. What are the methods available in Object ?
6. Is there any methods available in serialization ?
7. How you seralize an Object ?
8.How you get the serialized object ?
9. Any methods available in deseralization ?
|
View Answer
|
|
i want to know the difference between these two programs mean the flow /*public class Aquestion { private int i = giveMeJ(); private int j = 10; private int giveMeJ() { return j; } public static void main(String args[]) { System.out.println((new Aquestion()).i); } } */
public class Aquestion { private int j = 10; private int i = giveMeJ();
private int giveMeJ() { return j; } public static void main(String args[]) { System.out.println((new Aquestion()).i); } }
|
View Answer
|
|
How we can implement the constructer nesting in java
|
View Answer
|
|
Why single inheritance cannot be use in java/why we alwayz use multiple inheritances?
|
View Answer
|
|
What is the order of intialization of variables in Java.
|
View Answer
|
|
What is the difference between Inheritance and Aggrigation?
|
View Answer
|
|
What are some alternatives to inheritance?
|
View Answer
|
|
Which on is best string or string buffer?which one is mutable and immutable?
|
View Answer
|
|
It is essential to catch all types of exceptions
|
View Answer
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All Java Interview Questions & Answers - Exam Mode /
Learning Mode
|