Showing posts with label Java Information. Show all posts
Showing posts with label Java Information. Show all posts

October 09, 2013

Java Important Topics



Question 01: Give a few reasons for using Java?
Answer 01: Java is a fun language. Let’s look at some of the reasons:
  •  Built-in support for multi-threading, socket communication, and memory management (automatic garbage collection).
  •  Object Oriented (OO).
  •  Better portability than other languages across operating systems.
  •  Supports Web based applications (Applet, Servlet, and JSP), distributed applications (sockets, RMI. EJB etc) and network protocols (HTTP, JRMP etc) with the help of extensive standardised APIs (Application Program Interfaces).

Question 02: What is the difference between C++ and Java? LF
Answer 02: Both C++ and Java use similar syntax and are Object Oriented, but:

  •  Java does not support pointers. Pointers are inherently tricky to use and troublesome.
  •  Java does not support multiple inheritances because it causes more problems than it solves. Instead Java supports multiple interface inheritance, which allows an object to inherit many method signatures from different interfaces with the condition that the inheriting object must implement those inherited methods. The multiple interface inheritance also allows an object to behave polymorphically on those methods.
  •  Java does not support destructors but rather adds a finalize() method. Finalize methods are invoked by the garbage collector prior to reclaiming the memory occupied by the object, which has the finalize() method. This means you do not know when the objects are going to be finalized. Avoid using finalize() method to release non-memory resources like file handles, sockets, database connections etc because Java has only a finite number of these resources and you do not know when the garbage collection is going to kick in to release these resources through the finalize() method.
  •  Java does not include structures or unions because the traditional data structures are implemented as an object oriented framework
  • All the code in Java program is encapsulated within classes therefore Java does not have global variables or functions.
  •  C++ requires explicit memory management, while Java includes automatic garbage collection.
  • Blogger news

    This Blog Contains All Topics Related To Internet, Website Help, Interview Questions, News, Results From Various Resources, Visit Daily For More Interesting And Famous Topics.
  • Random Post

  • About

    We Provide All Information Which you Needed. We Maintain This Blog Very Carefully, If You Find Any Mistake or Any Suggestions Then Please Let Us Know, You Can Contact Us By Comments, On FB Page Or On Google+ Page. ~ Thank You