java1
java.util package
All collection classes are available in
JLabel
Components can display images
return;
Keyword is used to return a value inside a method
Encapsulation
achieved by combining methods and attribute into a class?
Compilation
is not OOPS concept in Java
Panel
is the container that doesn't contain title bar and MenuBars but it can have other components like button, textfield etc.
setText()
method can set or change the text in a Label?
javax.swing
To create swing components,is imported=
Button,List,MenuItem
=class is used for this Processing Method processActionEvent( )
0
Array indexes start with
Writer
Character streams uses Writer and Reader classes for input and output operations.
File file = new File("temp.txt"); FileReader in = new FileReader( file );
Code compile correctly
methodName()
Create a method in Java
int x = 5;
Create a variable with the numeric value 5
String
Data type is used to create a variable that should store text
Immutable
Encapsulation helps in writing classes in java
Classes
Encapsulation is supported by
actionPerformed
Events is fired when a button is clicked
C) class student { int a; public void disp(){ System.out.println(a); } }
Following uses encapsulation
Using Access Specifiers
How can Encapsulation be achieved?
class B extends A{}
If class B is subclassed from class A then the correct syntax
OutputStream
It is a class of the java.io package is an abstract superclass that represents an output stream of bytes
Encapsulation
It is a mechanism of wrapping the data (variables) and code acting on the data (methods)together as a single unit.
java.io.FileOutputStream
It is an output stream for writing data to a File or to a FileDescriptor.
OutputStream
It is use for writing data to a destination.
Byte Streams
It is use to perform input and output of 8-bit bytes
InputStream
It is use to read data from a source.
class
Keyword is used to create a class in Java
getSelectedItem()
Methods is used to get the selected item from a JComboBox
Encapsulation
OOP concept binds the code and data together and keeps them secure from the outside world
The + sign
Operator is used to add together two values
break;
Statement is used to stop a loop
A graphical user interface (GUI) toolkit
Swing in Java
By using the Access specifiers
The concept of encapsulation be achieved in the program
MyClass myObj = new MyClass();
The correct way to create an object called myObj of MyClass
Methods and Attribute
The encapsulation is achieved by combining which ones into a class?
passed as function
The object cannot be
GUI
The visual components of an application that the user interacts with are called
Ensured to some extent
Using the concept of encapsulation security of the data is
A subclass is a class that extends another class
What is subclass in java?
IOException
Which exception is thrown by read() method?
Abstraction
Which feature can be implemented using encapsulation?
InputStream
Which of these classes are used by Byte streams for input and output operation?
Writer
Which of these classes are used by character streams for input and output operations?
streams
Which of these is used to perform all input and output operations in Java?
Abstract Windowing Toolkit=
abbreviation of AWT
BufferedReader
class is used to read characters and strings in Java from console
Abstraction
is a way of converting real-world objects in terms of class is
Object-Oriented Programming
is about creating objects that contain both data and methods.
Procedural programming
is about writing procedures or methods that perform operations on the data
Frame
is used to store data and partial results, as well as to perform dynamic linking, return values for methods, and dispatch exceptions.
List
object can be constructed to show any number of choices in the visible window
==
operator can be used to compare two values
java.awt.event
package provides many event classes and Listener interfaces for event handling?
ActionEvent
these events is generated when a button is pressed
extends
this keyword must be used to inherit a class
Encapsulation and Abstraction
two features of object-oriented programming are the same