1)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?

Showing Answers 1 - 5 of 5 Answers

rajsekhar

  • May 16th, 2006
 

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++.

satish

  • May 16th, 2006
 

3 answer

the wrapping of data and functions into a single unit is called encapsulation

  Was this answer useful?  Yes

sujata

  • May 23rd, 2006
 

encapsulation is the mechanism that binds together code and the data it manipulates and keep both safe from outside interference and misuse.

  Was this answer useful?  Yes

shubha

  • May 25th, 2006
 

hi,

2.finally block can be used to handle any exception generated within a try block.it may be added immediately after the try block or after the last catch block.when a finally block is defined,this is guranteed to execute,regardless of whether or not an exception is thrown.

tq

  Was this answer useful?  Yes

shirisha49

  • May 31st, 2006
 

hi there, The code enclosed in finally block is a must-execute code. Whether an exception is raised or not it doesn't matter. If finally code block is embedded after an exception-handling block then the control must pass to finally block either after try-catch or no try-catch.Shirisha K.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions