Category Archives: Java

Java Tutorial


About Java programming language! Java is an object-oriented programming language. Java is compiled and interpreted. Java programming language has the following advantages: simplicity, portability, platform independence, object orientation, high security, high performance. Java is a programming platform that includes the following features: Java programming language Compiler A virtual machine called the Java Virtual Machine(JVM) A class library Object-oriented… Read More »

Java Swing

The main classes of the swing package are: JApplet JButton JCheckBox JCheckBoxMenuItem JColorChooser JComboBox JComponent JDesktopPane JDialog JFileChooser JFormattedTextField JFrame JInternalFrame JLabel JList JMenu JMenuBar JMenuItem JOptionPane JPanel JPasswordField JPopupMenu JProgressBar JRadioButton JRadioButtonMenuItem JSlider JScrollBar JScrollPane JSeparator JTable JTextArea JTextComponent JTextField JToggleButton JTree JWindow Timer

Java AWT

The main classes of the java awt package are: BorderLayout Button Canvas Checkbox CheckboxGroup CheckboxMenuItem Choice Color Component Container Dialog Dimension FileDialog FlowLayout Font Frame Graphics GridBagLayout GridLayout Image ImageCapabilities Label List Menu MenuBar MenuComponent MenuItem Panel Point PopupMenu Scrollbar ScrollPane TextArea TextComponent TextField Toolkit Window

Java I/O Streams

Java I/O Streams Java I/O Streams are used for reading or writing information that are on an external source. Java I/O Streams allow communication between two or more threads. In Java there are two types of streams: Byte Streams Character Streams Classes that perform input and output operations are stored in the package The main classes of… Read More »

Java Exceptions

Java Exceptions Exceptions in Java represent errors that occur during execution of a program. Exception handling is used to avoid undesirable display errors, but also easier to correct any errors. To handle exceptions occurred during runtime uses: The try-catch-finally Exception thrown by method throws Exception example Try-catch-finally example public class ExceptionExample{ public static void main(String [] args){ try{… Read More »

Java Packages

Java Packages A package is a collection of classes and related interfaces. Using java packages provide protection level of access. An major role of the package is the namespaces. Java packages are used to facilitate finding and using classes to avoid name conflicts and to control access to classes. To use a class or call a method of… Read More »

Java Interface

Java Interface A Java interface is a collection of abstract methods and constant declarations. Java interface contains abstract methods. Java interface can not be instantiated. A Java class can implement one or more interfaces. An interface can extend another interface using new methods abstract. The variables and methods of an interface are by default public. The methods declared… Read More »

Java Inheritance

Java Inheritance Inheritance is the process by which a Java class inherits another class content. A class that inherits another class attributes and behaviors take it. A private member of a class java can not be inherited. Class inherited is called the base class or superclass class. Inheritance is done by using the keyword extends. The class that… Read More »

Java Methods

Java Methods A method describe the behavior of an object. Methods define the operations that can be performed with the object. The methods can be found only in the classes. The methods consist of modifiers, declaring a name for the method, data type that the method returns, parameters and a block of instructions that are executed when the… Read More »

Java Classes

Java Classes A class is a description of a set of objects and may contain one or more constructors to create objects. All objects have the same attributes class and do the same operations, but their condition is different and have their own identity. A class is defined by specifying instance variables, instance methods and through relationships with… Read More »