![]() |
Login
New User
Search
|
| Home | |
| Java Technical Questions (Please Scroll Window all java subjects are covered here) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Thanks to Sachin Rastogi for contributing these.
|
|
Thanks to Sachin Rastogi for contributing these.
|
Thanks to Sachin Rastogi for sending this set in.
|
|
Thanks to Sachin Rastogi for sending in Java database interview questions.
|
|
|
|
|
|
1) Can a class be it’s own event handler? Explain how to implement this. Answer: Sure. an example could be a class that extends Jbutton and implements ActionListener. In the actionPerformed method, put the code to perform when the button is pressed. 2) Why does JComponent have add() and remove() methods but Component does not? 3) How would you create a button with rounded edges? 4) If I wanted to use a SolarisUI for just a JTabbedPane, and the Metal UI for everything else, how would I do that? 5) What is the difference between the ‘Font’ and ‘FontMetrics’ class? 6) What class is at the top of the AWT event hierarchy? 7) Explain how to render an HTML page using only Swing. 8) How would you detect a keypress in a JComboBox? 9) Why should the implementation of any Swing callback (like a listener) execute quickly? 10) In what context should the value of Swing components be updated directly? 11) Why would you use SwingUtilities.invokeAndWait or SwingUtilities.invokeLater? 12) If your UI seems to freeze periodically, what might be a likely reason? 13) Which Swing methods are thread-safe? 14) Why won’t the JVM terminate when I close all the application windows? |
Q1: What are the advantages of OOPL? |
|
Question 1: What is the three tier model? Answer: It is the presentation, logic, backend Question 2: Why do we have index table in the database? Answer: Because the index table contain the information of the other tables. It will be faster if we access the index table to find out what the other contain. Question 3: Give an example of using JDBC access the database. Answer: try { Class.forName("register the driver"); Connection con = DriverManager.getConnection("url of db", "username","password"); Statement state = con.createStatement(); state.executeUpdate("create table testing(firstname varchar(20), lastname varchar(20))"); state.executeQuery("insert into testing values(’phu’,'huynh’)"); state.close(); con.close(); } catch(Exception e) { System.out.println(e); } Question 4: What is the different of an Applet and a Java Application Answer: The applet doesn’t have the main function Question 5: How do we pass a reference parameter to a function in Java? Answer: Even though Java doesn’t accept reference parameter, but we can pass in the object for the parameter of the function. For example in C++, we can do this: void changeValue(int& a) however in Java, we cannot do the same thing. So we can pass the |
Q: What are the most common techniques for reusing functionality in object-oriented systems?
|
QUESTION: What is a JavaBean? (asked by Lifescan inc) Sockets are flexible and sufficient. Efficient socket based programming can be easily implemented for general communications. Sockets cause low network traffic. Unlike HTML forms and CGI scripts that generate and transfer whole web pages for each new request, Java applets can send only necessary updated information. Disadvantages of Java Sockets: Security restrictions are sometimes overbearing because a Java applet running in a Web browser is only able to establish connections to the machine where it came from, and to nowhere else on the network Despite all of the useful and helpful Java features, Socket based communications allows only to send packets of raw data between applications. Both the client-side and server-side have to provide mechanisms to make the data useful in any way. Since the data formats and protocols remain application specific, the re-use of socket based implementations is limited. QUESTION: What is the difference between a NULL pointer and a void pointer? (asked by Lifescan inc) |
1) What is the purpose of garbage collection in Java, and when is it used?
|
Q:In Java, what is the difference between an Interface and an Abstract class? A: An Abstract class declares have at least one instance method that is declared abstract which will be implemented by the subclasses. An abstract class can have instance methods that implement a default behavior. An Interface can only declare constants and instance methods, but cannot implement default behavior. Q: Can you have virtual functions in Java? Yes or No. If yes, then what are virtual functions? A: Yes, Java class functions are virtual by default. Virtual functions are functions of subclasses that can be invoked from a reference to their superclass. In other words, the functions of the actual object are called when a function is invoked on the reference to that object. Q:Write a function to reverse a linked list p in C++? A: Link* reverse_list(Link* p) Link* h = p; return h; Q:In C++, what is the usefulness of Virtual destructors? A:Virtual destructors are neccessary to reclaim memory that were allocated for objects in the class hierarchy. If a pointer to a base class object is deleted, then the compiler guarantees the various subclass destructors are called in reverse order of the object construction chain. Q:What are mutex and semaphore? What is the difference between them? A:A mutex is a synchronization object that allows only one process or thread to access a critical code block. A semaphore on the other hand allows one or more processes or threads to access a critial code block. A semaphore is a multiple mutex.
|
Question1: What is a Servlet? Answer: Servlets are modules of Java code that run in a server application (hence the name "Servlets", similar to "Applets" on the client side) to answer client requests. Question2: What advantages does CMOS have over TTL(transitor transitor logic)? (ALCATEL) Answer:
How is Java unlike C++? (Asked by Sun) Answer: Some language features of C++ have been removed. String manipulations in Java do not allow for buffer overflows and other typical attacks. OS-specific calls are not advised, but you can still call native methods. Everything is a class in Java. Everything is compiled to Java bytecode, not executable (although that is possible with compiler tools). Question4: What is HTML (Hypertext Markup Language)? Answer: HTML (HyperText Markup Language) is the set of "markup" symbols or tags inserted in a file intended for display on a World Wide Web browser. The markup tells the Web browser how to display a Web page’s words and images for the user. Question5: Define class. Answer: A class describes a set of properties (primitives and objects) and behaviors (methods).
|
1. Why do you prefer Java? Answer: write once ,run anywhere. 2. Name some of the classes which provide the functionality of collation? Answer: collator, rulebased collator, collationkey, collationelement iterator. 3. Awt stands for? and what is it? Answer: AWT stands for Abstract window tool kit. It is a is a package that provides an integrated set of classes to manage user interface components. 4. why a java program can not directly communicate with an ODBC driver? Answer: Since ODBC API is written in C language and makes use of pointers which Java can not support. 5. Are servlets platform independent? If so Why? Also what is the most common application of servlets? Answer: Yes, Because they are written in Java. The most common application of servlet is to access database and dynamically construct HTTP response
|
| Yuva Jobs.com Designed and Developed By Gaurav Jain | Copyright © 2003-2004 to GauravJain.net |
| © Copyright 2004, Yuva Jobs | GauravJain.net | For Sales or Ads On Yuva Jobs.com Contact Gaurav Jain : sapgaurav@yahoo.com |