Showing posts with label J2EE application. Show all posts
Showing posts with label J2EE application. Show all posts

Compiling and Running an Application in Java

To compile and run the program you need the JDK distributed by Sun Microsystems. The JDK contains documentation, examples, installation instructions, class libraries and packages, and tools. Download an editor like Textpad/EditPlus to type your code. You must save your source code with a .java extension. The name of the file must be the name of the public class contained in the file.

Steps for Saving, compiling and Running a Java

Step 1:Save the program With .java Extension.
Step 2:Compile the file from DOS prompt by typing javac .
Step 3:Successful Compilation, results in creation of .class containing byte code
Step 4:Execute the file by typing java

Java Packages,Java Package's Interview Questions ,core java IT technical interview questions

Java interfaces and classes are grouped into packages. The following are the java packages, from which you can access interfaces and classes, and then fields, constructors, and methods.


java.lang
Package that contains essential Java classes, including numerics, strings, objects, compiler, runtime, security, and threads. This is the only package that is automatically imported into every Java program.
java.io
Package that provides classes to manage input and output streams to read data from and write data to files, strings, and other sources.
java.util
Package that contains miscellaneous utility classes, including generic data structures, bit sets, time, date, string manipulation, random number generation, system properties, notification, and enumeration of data structures.
java.net
Package that provides classes for network support, including URLs, TCP sockets, UDP sockets, IP addresses, and a binary-to-text converter.
java.awt
Package that provides an integrated set of classes to manage user interface components such as windows, dialog boxes, buttons, checkboxes, lists, menus, scrollbars, and text fields. (AWT = Abstract Window Toolkit)
java.awt.image
Package that provides classes for managing image data, including color models, cropping, color filtering, setting pixel values, and grabbing snapshots.
java.awt.peer
Package that connects AWT components to their platform-specific implementations (such as Motif widgets or Microsoft Windows controls).
java.applet
Package that enables the creation of applets through the Applet class. It also provides several interfaces that connect an applet to its document and to resources for playing audio.

Difference between Vector and ArrayList? What is the Vector class?

Vector is synchronized whereas ArrayList is not. The Vector class provides the capability to implement a growable array of objects. ArrayList and Vector class both implement the List interface. Both classes are implemented using dynamically resizable arrays, providing fast random access and fast traversal. In vector the data is retrieved using the elementAt() method while in ArrayList, it is done using the get() method. ArrayList has no default size while vector has a default size of 10. when you want programs to run in multithreading environment then use concept of vector because it is synchronized. But ArrayList is not synchronized so, avoid use of it in a multithreading environment.

J2EE Interview Questions


1)What is J2EE?

2)What is the J2EE module?

3)What are the components of J2EE application?

4)What are the four types of J2EE modules?

5)What does application client module contain?

6)What does Enterprise JavaBeans module contain?

7)What does resource adapt module contain?

8)How many development roles are involved in J2EE application?

9)What is difference between J2EE 1.3 and J2EE 1.4?

10)Is J2EE application only a web-based?

11)Are JavaBeans J2EE components?

12)Is HTML page a web component?

13)What is the container?

14)What is the web container?

15)What is the thin client?

16)What are types of J2EE clients?

17)What is deployment descriptor?

18)What is the EAR file?

19)What are JTA and JTS?

20)What is JAXP?

21)What is J2EE Connector?

22)What is JAAP?

23)What is Model 1?

24)What is Model 2?

25)What is Struts?

26)How is the MVC design pattern used in Struts framework?

27)Do you have to use design pattern in J2EE project?

28)Is J2EE a super set of J2SE?

29)What does web module contain?

30)What APIs are available for developing a J2EE application?