1/20
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Java Packages
A group of similar types of classes, interfaces and sub-packages.
Built-in Package
User-defined Package
Package in java can be categorized in two form, ________ and __________.
java
lang
awt
javax
swing
net
io
util
Some example of built-in packages
Java package is used to categorize the classes and interfaces so that they can be easily maintained.
Java package provides access protection.
Java package removes naming collision.
Advantages of Java Package
Folder in a file directory
A package in Java is used to group related classes. Think of it as a ___________. We use packages to avoid name conflicts, and to write a better maintainable code.
Built-in Packages
Packages from the Java API.
User-defined Packages
Create your own package.
Java API
A library of prewritten classes, that are free to use, included in the Java Development Environment
Packages
Classes
Java API is divided into ______ and _____. Meaning you can either import a single class (along with its methods and attributes), or a whole package that contain all the classes that belong to the specified package.
import package.name.*;Syntax when importing the whole package
import package.name.Class;Syntax when importing a single class.
Package
import java.util.Scanner;In the example, java.util is a ______, while Scanner is a class of the java.util package.
Class
import java.util.Scanner;In the example, java.util is a package, while Scanner is a _____ of the java.util package.
Java Swing Tutorial
A part of Java Foundation Classes (JFC) that is used to create window-based applications. It is built on the top of AWT (Abstract Windowing Toolkit) API and entirely written in java.
Abstract Windowing Toolkit
AWT
Java Foundation Classes
JFC
Java Swing
Provides platform-independent and lightweight components.
JButton
JTextField
JTextArea
JRadioButton
JCheckbox
JMenu
JColorChooser
The javax.swing package provides classes for java swing API such as …..
Association
Inheritance
Two ways in creating a frame using Java Swing
Association
By creating the object of Frame class.
Inheritance
By extending Frame class.