Escolar Documentos
Profissional Documentos
Cultura Documentos
Answer:
?interface contains methods that must be abstract; abstract class may contain
concrete methods.
?interface contains variables that must be static and final; abstract class may
contain non-final and final variables.
?interface is used to implements; whereas abstract class is used to extends. ?interface can be used to achieve multiple inheritance; abstract class can be used
as a single inheritance.
?interface can extends another interface, abstract class can extends another
class and implements multiple interfaces.
?interface is absolutely abstract; abstract class can be invoked if a main() exists. ?interface is more flexible than abstract class because one class can only extends
one super class, but implements multiple interfaces.
Name the containers which uses Border Layout as their default layout?
Answer: Containers which uses Border Layout as their default are: window, Frame and Dialog classes.
} E.g. Synchronizing a block of code inside a function: public myFunction (){ synchronized (this) { // Synchronized code here. } }
What is OOPS?
Answer: OOP is the common abbreviation for Object-Oriented Programming.
Answer: From a practical programming viewpoint, polymorphism exists in three distinct forms in Java: ? Method overloading ? Method overriding through inheritance ? Method overriding through the Java interface
What is the difference between and <%@ include file = ... >?.
Answer: Both the tag includes the information from one page in another. The differences are as follows: : This is like a function call from one jsp to another jsp. It is executed ( the included page is executed and the generated html content is included in the content of calling jsp) each time the client page is accessed by the client. This approach is useful to for modularizing the web application. If the included file changed then the new content will be included in the output. <%@ include file = ... >: In this case the content of the included file is textually embedded in the page that have <%@ include file=".."> directive. In this case in the included file changes, the changed content will not included in the output. This approach is used when the code from one jsp file required to include in multiple jsp files.
response.sendRedirect(url),?
Answer: The element forwards the request object containing the client request information from one JSP file to another file. The target file can be an HTML file, another JSP file, or a servlet, as long as it is in the same application context as the forwarding JSP file. sendRedirect sends HTTP temporary redirect response to the browser, and browser creates a new request to go the redirected page. The response.sendRedirect kills the session variables.
What are all the different scope values for the tag?
Answer: tag is used to use any java object in the jsp page. Here are the scope values for tag: a) page b) request c) session and d) application
<%=getCount()%>
What is J2EE?
Answer: J2EE Stands for Java 2 Enterprise Edition. J2EE is an environment for developing and deploying enterprise applications. J2EE specification is defined by Sun Microsystems Inc. The J2EE platform is one of the best platform for the development and deployment of enterprise applications. The J2EE platform is
consists of a set of services, application programming interfaces (APIs), and protocols, which provides the functionality necessary for developing multi-tiered, web-based applications. You can download the J2EE SDK and development tools from http://java.sun.com/.
b) Java classes c) gif and html files and d) web component deployment descriptors
Why J2EE is suitable for the development distributed multitiered enterprise applications?
Answer: The J2EE platform consists of multi-tiered distributed application model. J2EE applications allows the developers to design and implement the business logic into components according to business requirement. J2EE architecture allows the development of multi-tired applications and the developed applications can be installed on different machines depending on the tier in the multi-tiered J2EE environment . The J2EE application parts are:
a) Client-tier components run on the client machine. b) Web-tier components run on the J2EE server. c) Business-tier components run on the J2EE server and the d) Enterprise information system (EIS)-tier software runs on the EIS servers
What is JAXP?
Answer: The Java API for XML Processing (JAXP) enables applications to parse and transform XML documents independent of a particular XML processing implementation. JAXP or Java API for XML Parsing is an optional API provided by Javasoft. It provides basic functionality for reading, manipulating, and generating XML documents through pure Java APIs. It is a thin and lightweight API that provides a standard way to seamlessly integrate any XML-compliant parser with a Java application.
Answer: Java Bean as is a plain java class with member variables and getter setter methods. Java Beans are defined under JavaBeans specification as Java-Based software component model which includes the features like introspection, customization, events, properties and persistence. Enterprise JavaBeans or EJBs for short are Java-based software components that comply with Javas EJB specification. EJBs are delpoyed on the EJB container and executes in the EJB container. EJB is not that simple, it is used for building distributed applications. Examples of EJB are Session Bean, Entity Bean and Message Driven Bean. EJB is used for server side programming whereas java bean is a client side. Bean is only development but the EJB is developed and then deploy on EJB Container.
synchronization and propagation services are also provided under the domain of transaction management. In the Java transaction model, the Java application components can conduct transactional operations on JTA compliant resources via the JTS. The JTS acts as a layer over the OTS. The applications can therefore initiate global transactions to include other OTS transaction managers, or participate in global transactions initiated by other OTS compliant transaction managers.
The four transaction isolation levels and the corresponding behaviors are described below:
Isolation Level Read Uncommitted Read Committed Repeatable Read Serializable Dirty Read Possible Not possible Not possible Not possible Non-Repeatable Read Possible Possible Not possible Not possible Phantom Read Possible Possible Possible Not possible
How can one prove that the array is not null but empty?
Answer: Print args.length. It will print 0. That means it is empty. But if it would have been null then it would have thrown a NullPointerException on attempting to print args.length.
Java interpreter before any objects are made. (v) CASE SENSITIVE : Main () is different from main(). It is important to know that that Main() would be compiled. But the Java interpreter would report an error if it would not find main().
Answer: In a 100% Object oriented language, everything is an Object. That is not the case with Java. Java uses primitive types such as int, char, double. Java primitive types ARE NOT OBJECTS. All the rest are objects. Keep in mind that int, char and other primitive types CAN NOT BE STORED in collections (e.g. Vector, Hashtable) to store these types in a collections, you need to Use wrapper classes (e.g. Integer, Double).
class football extends sports { } class hockey extends sports { } class baseball extends sports { } sports [ ] mysports = { new football (), new hockey (), new baseball ()};
Answer: The key difference is that JSF runs on the server in a standard Java servlet container like Tomcat or WebLogic and generates html output that is viewed on Web browsers (This client). Swing is used for creating Thick clients.
What is JSF?
Answer: JSF stands for Java Server Faces, or simply Faces. It is a framework for building Web-based user interfaces in Java. Like Swing, it provides a set of standard widgets such as buttons, hyperlinks, checkboxes, and so on.
What Is a Socket?
Answer: A socket is one end-point of a two-way communication link between two programs running on the network. A socket is bound to a port number so that the TCP layer can identify the application that data is destined to be sent. Socket classes are used to represent the connection between a client program and a server program. The java.net package provides two classesSocket and ServerSocket which implement the client side of the connection and the server side of the
connection, respectively.
What is RMI?
Answer: RMI is a set of APIs that allows to build distributed applications. RMI uses interfaces to define remote objects to turn local method invocations into remote method invocations.
What is JNDI
Answer: Abbreviate of Java Naming and Directory Interface.
What is CDATA ?
Answer: A predefined XML tag for character data that means dont interpret these characters, as opposed to parsed character data (PCDATA), in which the normal rules of XML syntax apply. CDATA sections are typically used to show examples of XML syntax.
What is CORBA ?
Answer: Common Object Request Broker Architecture. A language-independent distributed object model specified by the OMG.
What is CTS ?
Answer: Compatibility test suite. A suite of compatibility tests for verifying that a J2EE product complies with the J2EE platform specification.