Save
Upgrade to remove ads
Busy. Please wait.
Log in with Clever
or

show password
Forgot Password?

Don't have an account?  Sign up 
Sign up using Clever
or

Username is available taken
show password


Make sure to remember your password. If you forget it there is no way for StudyStack to send you a reset link. You would need to create a new account.
Your email address is only used to allow you to reset your password. See our Privacy Policy and Terms of Service.


Already a StudyStack user? Log In

Reset Password
Enter the associated with your account, and we'll email you a link to reset your password.
focusNode
Didn't know it?
click below
 
Knew it?
click below
Don't Know
Remaining cards (0)
Know
0:00
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.

  Normal Size     Small Size show me how

OOP terms review

m1 to m10

QuestionAnswer
MODULE 1 M1
Java - Oak Java language, originally called the ‘Oak’, was developed by James Gosling at Sun Microsystems, which is now a subsidiary of Oracle Corporation, and released in 1995 as a core component of Sun Microsystems' Java platform.
Java It has derived much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities.
Java Definition a general-purpose, concurrent, class-based, object oriented language that is specifically designed to have as few implementation dependencies as possible.
Java Source code files files with .java extension. These are compiled into a format called bytecode.
Bytecode (files with .class extension), can be executed by a Java interpreter.
Java Definition was intended for use in Sun’s project research to work on a programming software to control electronic devices. It was modified to take advantage of the World Wide Web.
WebRunner later named as HotJava, was the very first web browser created in Java
Netscape Navigator browser Developed in 1995 to support java.
Features of Java 1. Simple, object-oriented, and familiar 2. Robust and secure 3. Architecture neutral and portable 4. High performance 5. Interpreted, threaded, and dynamic
Java Editions J2SE: Java 2 Standard Edition J2EE: Java 2 Enterprise Edition J2ME: Java 2 Micro Edition
Java Virtual Machine (JVM) Java is a portable language that could run on any platform. The language was able to do this by generating intermediate code for a hypothetical computer called a virtual machine
Java Virtual Machine (JVM) a program that runs on all computers. The JVM creates a software simulation of a CPU and memory and handles all communication between the Java program and the underlying operating system and hardware.
The Java source code (__) is normally compiled to produce the bytecode file (___) which is normally interpreted by the Java virtual machine (JVM). .java file .class file
JVM Architecture source code -> javac -> byte code -> Java Virtual Machine -> machine code
J2SDK (JDK) Java 2 Software Development Kit
Java 2 Software Development Kit contains • java –the loader for Java applications • javac– the compiler • javadoc– the documentation generator • other tools
Steps in creating a java application 1. Create the source code. 2. Compile the source code. 3. Run the program
NETBEANS SKIP FOR NOW NEATBEANS
MODULE 2 M2
BASIC STRUCTURE OF A JAVA CLASS BASIC STRUCTURE OF A JAVA CLASS
class HelloWorld defines a class, a template for an object of derived type HelloWorld
public access specifier/modifier, the main method is declared public so that it is accessible as part of the public interface of the program
static state of the method, it is static because it must be called before the class that hosts the method is instantiated
void It returns void because the Java interpreter does not expect to receive or process any output from the class.
System.out.println( ) The println method is one of dozens of methods in the System class. The System class is a part of the core Java language package of the Application Programming Interface (API)
API Application Programming Interface
JAVA LANGUAGE FUNDAMENTALS JAVA LANGUAGE FUNDAMENTALS
Identifiers are names that are given by the programmer as name of variables, methods or functions, classes etc.
Rules of Identifiers ØEach character is either a digit, letter, underscore or currency symbol. ØFirst character cannot be a digit. ØThe identifier name must not be a reserved word
Types of Java Comments 1. A single-line comment starting with // 2. A multi-line comment enclosed within /* */ 3. A documentation or javadoc comment is enclosed between /** and */. These comments are used to generate HTML documents using the javadoc utility.
JAVA DATA TYPES PRIMITIVE, width in bytes JAVA DATA TYPES
byte width = 1 Min value = -128 max value = 127
short width = 2 min value = -32768 max value = 32767
int width = 4 min value = -2147483648 max value = 2147483647
long width = 8 min value = Long.MIN_VALUE max value = Long.MAX_VALUE
float width = 4 min value = Float.MIN_VALUE max value = Float.MAX_VALUE
double width = 8 min value = DOUBLE.MIN_VALUE max value = DOUBLE.MAX_VALUE
boolean width = 1 bit min value = true max value = false
char width = 2 unsigned min value = ‘\u0000’ max value = ‘\uFFFF’
1 byte = 8 bits
DERIVED DATA TYPES String Date Integer Double Long Float
Variable declaration Syntax: <datatype> <varName>; [= value;]
Java Wrapper Classes used in converting one data type (such as a String) into another data type (such as int or double). It is also used in wrapping a primitive value into an object
WRAPPER CLASS Integer Float Double Long Byte Short Character Boolean PRIMITIVE TYPE int float double long byte short char boolean
Java Output In Java, you can simply use System.out.println(); or System.out.print(); or System.out.printf(); System is a class out is a public static field: it accepts output data.
Difference between java outputs print()- It prints string inside the quotes println() - prints string inside quotes, moves to the next line after printf() - Tt provides string formatting
Java User Input The Scanner class is used to get user input, and it is found in the java.util package import java.util*/ To use the Scanner class, create an object of the class and use any of the available methods found in the Scanner class documentation.
SCANNER INPUT TYPES nextBoolean() nextByte() nextDouble() nextFloat() nextInt() nextLine() nextLong() nextShort() INPUTS PRIMITIVE TYPES: boolean byte double float int string long short
MODULE 3 M3
JAVA OPERATORS 1. Unary Arithmetic Operators 2. Binary Arithmetic Operators 3. Bitwise Operators 4. Shift Operators
Unary arithmetic operators + - = sign operators ++ = increment -- = decrement Increment and decrement operators have two formats: postfix and prefix. a++ or ++a
Binary arithmetic operators + addition - subtraction * multiplication / division % modulo Order of precedence: */%, + -
Guidelines to consider when using Arithmetic Operators ØUse parentheses to alter precedence. ØConsider the size of resulting values and possible loss of precision. ØApply arithmetic operators’ precedence level
Guidelines to consider when using Arithmetic Operators Modulo with negative number, drop the negative sign, the sign of left operand is the sign of the result. The (+) operator can be used to add numbers and String objects. Dividing integer by zero results in the throwing of ArithmeticException
Bitwise Operator Øworks on integer values, by manipulating its bit-pattern equivalent
~ = Bitwise inversion (unary) | = Bitwise OR & = Bitwise AND ^ = Bitwise EX-OR No short circuit before a = true, b = 1 i.e. (~a) & (++b) = false. after a = false, b = 2 logical operators i.e. (~a) && (++b) a = false, b = still 1 Note of use, bitwise is different from logical operators. Bitwise operators doesn't utilize short circuiting. Meaning that even if the result of boolean is already determined, it will still continue to perform any process.
Shift Operators >> | op1>>op2 shift bits of op1 by distance op2 << | op1<<op2 >>> | op1>>>op2 shift bits of op1 right by distance op2 (unsigned) performs bit manipulation on data by shifting the bits of its first operand right or left.
Relational Operators > >= < <= == != compares two values and determines the relationship between them.
Logical Operators && short circuit AND || short circuit OR & | Short Circuit - stop evaluation early if the result is already determined. often used with relational operators to construct more complex decision-making expressions.
Cast Operator int number = (int)dbl; used in converting (casting) one type into another type or an object into another object. Syntax: (Cast type) Value;
Assignment Operator Example: int a=10; a+=10; // a = a+ 10 a-=10; // a = a- 10 a*=10; // a = a* 10 a/=10; // a = a/ 10 Used to assign values to a variable Shorthand operator if combined with other operators
Ternary Operator an operator that deals with three operands Syntax: variable = condition ? value : value;
MODULE 4 M4
JAVA CONTROL STUCTURE if, else statement switch, case statement while loop do, while loop for loop
If-else statement Syntax: if(condition/boolean expression) { //codes to execute if the condition is true } else { //codes to execute if the condition is false } The if statement enables your program to selectively execute other statements, based on some criteria The else statement performs a different set of statements if the expression is false.
Switch statement The switch statement is used to conditionally perform statements based on an integer expression. Syntax: switch(varName) { case const1: codes here; break; case const2: codes here; break; default: codes here; break; }
Keywords BREAK The break statement causes the program flow to exit from the body of the switch construct. Each case label takes only a single argument, but when execution jumps to one of these labels, it continues downward until it reaches a break statement
DEFAULT The default keyword is comparable to the else part of the if statement. The statements associated with this keyword is executed if the value of the switch variable does not match any of the case constants
While statement The while loop executes a given statement or block of statements repeatedly as long as the value of the expression is true. Syntax: while(condition/expression) { //codes to execute if condition is true }
do-while statement Syntax: do{ //codes to execute if condition is true } while(condition/expression); The do-while loop facilitates evaluation of condition or expression at the end of the loop to ensure that the statements are executed at least once .
for statement The for loop executes a given statement or a block of statements for a definite number of times. Syntax: for (initialization; condition; altering list) { //codes to execute if condition is true }
foreach statement Syntax: for(initialization : [collection/array]) { //codes to execute if condition is true } The foreach loop is for traversing items in a collection. foreach is usually used in place of a standard for statement. It usually maintain no explicit counter: they essentially say "do this to everything in this set".
break statement The break statement causes the program flow to exit prematurely from the body of the loop statement Syntax: break [label];
continue statement The continue statement causes the program flow to skip over and jump to the end of the loop body, and then return the control to the loop control statement Syntax: continue [label];
label The label identifies any valid statement to which control must be transferred Syntax: [label:] statements;
Arrays a structure that holds multiple values of the same type. The length of an array is established when the array is created (at runtime). After creation, an array is a fixed-length structure.
Array structure Length is always 1 more than index i.e. if length of array is 10, then first index is 0 and last is 9 index always starts at 0
Array declaration Syntax: type arrayName[ ] = new type[length]
Array initialization Syntax: type arrayName[ ] = {value,value,…}
Store values in arrayy Syntax: arrayName[index] = value;
Multidimensional arrays Syntax: type[ ][ ] = new type[row][column];
MODULE 5 M5
Procedural Programming is a technique of solving a problem and breaking it down into smaller parts and solving each of the smaller problems
Procedural Programming This model of software development is process-centric or procedural since it concentrates on the procedures in a system
Object-Oriented Programming It describes the task to be performed on objects. These objects that have to be created and stored in the computer memory, contain data and instructions to perform tasks specific to that object.
PROCEDURAL VS OOP The focus of procedural programming is to break down a programming task into a collection of variables, data structures, and subroutines
PROCEDURAL VS OOP Whereas in object-oriented programming, it is to break down a programming task into objects that expose behavior (methods) and data (members or attributes) using interfaces
PROCEDURAL VS OOP The most important distinction is that while procedural programming uses procedures to operate on data structures, object-oriented programming bundles the two together, so an "object", which is an instance of a class, operates on its "own" data structure
PROCEDURAL VS OOP PROCEDURAL OOP procedure method record object module class procedure call message
Object-Oriented Programming It uses a collection of objects interacting with each other. Advantage of OOP: enables programmers to create modules that need not be changed when a new type of object is added.
Benefits of OOP Reduced software complexities and realistic modelling through the use of various techniques: 1.Abstraction 2.Encapsulation 3.Inheritance 4.Polymorphism
Abstraction process of picking out the common features of objects and procedures. This process focuses on the essential characteristics of an object
Encapsulation the process of hiding the implementation details of an object.
Benefits of OOP Software reusability by implementing inheritance. Programs are built that can be used by several other applications
Inheritance allows an object to extend its characteristics to another object
Benefits of OOP Resilience to change with the use of polymorphism
Polymorphism ability to process objects differently depending on their data type or class.
Class A class is a template or blueprint that defines an object’s attributes and operations and that is created at design time
Object An object is a running instance of a class that consumes memory and has a finite lifespan
Object Relationships: 1.Association 2.Inheritance 3.superclass (base class) 4.subclass (derived class) 5.abstract class
1.Association exists when an object contains a reference to another object. Referred to as the “has a” relationship.
2.Inheritance referred to as the “kind of” or “is a” relationship.
3.superclass (base class) the parent class from which properties are inherited by another class
4.subclass (derived class) a new class with properties taken from a parent class
5.abstract class a well-encapsulated conceptual class. The objects of this class do not exist in real world
Unified Modeling Language (UML) a general-purpose notational language used for specifying and visualizing complex software, usually large object-oriented project.
Unified Modeling Language (UML) It uses several types of diagrams such as the case diagram, class diagram, and state chart diagram.
Class Diagram A class diagram is used to describe the attributes and behaviours of objects in the system
Attributes and Operations ØAttributes are the data contained in a class ØOperations are the actions performed on that data ØAccessibility: Public (+), Private (-), Protected (#)
UML Access Modifier Symbols + public - private # protected ~ package " " default italics - abstract class method uderline - static method or attribute
DECLARING CLASSES A class definition is consist of several constructs for defining and declaring the following: 1. Attributes 2. Constructor 3. Standard Methods • Mutator (Setter) • Accessor (Getter) 4. Custom Methods
Attributes declared either at the start or end of a class definition. These variables identify the data stored in the object
Constructor a method that is automatically executed when an object is created. This method is used to initialize the attributes
Standard Methods used to change or access the private data in an object • Mutator (Setter) – a method that is used to change the data. • Accessor (Getter) – a method that is used to access or retrieve data
Custom Methods implement the business rules for which the application is being developed
this keyword contains a reference to the current object being constructed. It represents an instance of the class in which it appears. It can be used to access class variables and methods
USAGE OF THIS 1. can be used to refer current class instance variable. 2. this() can be used to invoke current class constructor. 3. can be used to invoke current class method (implicitly)
USAGE OF THIS 4. can be passed as an argument in the method call. 5. can be passed as argument in the constructor call. 6. can also be used to return the current class instance
Access Modifiers a) private b) public c) default (no keyword) d) protected
private only accessible within a class where it is declared
public accessible from all classes
default (no keyword) accessible only within the package If you don't use any modifier, it is treated as default by default.
protected accessible within and outside the package but through inheritance only. It can be applied on the data member, method and constructor. It can't be applied on the class.
Modifiers/Qualifiers 1. final 2. static 3. abstract 4. interface
final Class: a class that can never be sub-classed Variable: constant variable Method: a method that cannot be overridden.
static Variable: used in defining a class variable. Method: used in defining a class method
Classification of Variables 1.Instance Variables (non-static fields) 2. Class Variables (static fields) 3. Local Variables (method variables or local data)
Instance Variables (non-static fields) variables stored in each object of a class, usually referred to as the non-static member fields of a class.
Class Variables (static fields) variables stored in the class and are available to all objects of a class or objects of other classes if access is permitted, usually referred to as the static members of the class.
Local Variables (method variables or local data) data used in a method. This data is temporary and does not exist once the method has completed execution
MODULE 6 M6
Encapsulation Encapsulation, is to make sure that "sensitive" data is hidden from users.
Methods of applying Encapsulation • declare class variables/attributes as private (only accessible within the same class) • provide public setter and getter methods to access and update the value of a private variable
Getter and Setter getter (accessor) and setter (mutator) Used to provide access to private variables, which can only be normally accessed within the same class, outside the class.
Getter and Setter getter (accessor) and setter (mutator) The get method returns the variable value, and the set method sets the value
Why Encapsulation? ØBetter control of class attributes and methods ØClass variables can be made read-only (if you omit the set the get method), or write-only (if you omit method)
Why Encapsulation? ØFlexible: the programmer can change one part of the code without affecting other parts ØIncreased security of data
Inheritance The technique of deriving new class definitions from an existing class definition.
Benefits of using Inheritance in OOP extends keyword •Re-use of predefined and well-tested classes •Standardization of behaviors across a group of classes •Ability to use members of a family of classes interchangeably in method
Superclasses and Subclasses Superclass is the class from which another class inherits properties. This is a class that is on top of a hierarchy
Superclasses and Subclasses ØSubclass is a class that inherits all the non-private attributes and methods, except constructors from a superclass. This class has the ability to override methods of the superclass
Type of inheritance: Single inheritance - subclasses are derived from a single superclass. Multiple inheritance - subclasses are derived from more than one superclass
Java supported inheritance Does not support multiple inheritance. however, Java provides same effects and benefits of multiple inheritance through the use of interface
super keyword contains a reference to the parent class (superclass) object. used to access members of a class inherited by the class in which it appears. explicitly call a constructor of its immediate superclass.
super keyword A super constructor call in the constructor of a subclass will result in the execution of relevant constructor from the superclass, based on the arguments passed
super keyword guidelines regarding constructor 1. The super() call MUST OCCUR THE FIRST STATEMENT IN A CONSTRUCTOR. 2. The super() call can only be used in a constructor definition. 3. This implies that the this() construct and the super() calls CANNOT BOTH OCCUR IN THE SAME CONSTRUCTOR.
Overriding Methods A subclass can override a method defined in its superclass by providing a new implementation for that method
Final Methods and Final Classes final classes - Classes that can no longer be subclassed. final methods - methods that cannot be overridden.
MODULE 7 M7
Polymorphism ability of objects belonging to different types to respond to methods of the same name, each one according to the right type specific behavior.
Polymorphism It is the ability to redefine methods for derived classes
Method Overloading Using one method identifier to refer to multiple functions in the same class, In the Java programming language, methods can be overloaded but not variables or operators
Constructor Overloading creating more than one constructor in a class
Method Overloading creating multiple methods having same name in one class.
Method Overriding Providing a different implementation of a method in a subclass of the class that originally defined a method
Overloading VS. Overriding Overloaded functions supplement each other Overriding function replaces the function it overrides
Overloading VS. Overriding Overloaded functions can exist, in any number, in the same class Each function in a base class can be overridden at most once in any one derived class
Overloading VS. Overriding Overloaded functions must have different argument lists. Overriding functions must have argument lists of identical type and order.
Overloading VS. Overriding The return type of an overloaded function may be chosen freely. The return type of an overriding method must be identical to the function it overrides
Polymorphism allows multiple objects of different subclasses to be treated as objects of a single superclass, while automatically selecting the proper methods to apply to a particular object based on the subclass it belongs to.
Abstraction The Abstract Class and Interface can never be instantiated
Abstract Class contains one or more abstract methods and, therefore, can never be instantiated. It is defined so that other classes can extend them and make them concrete by implementing the abstract methods.
Abstract Class All abstract classes are public by default and cannot be instantiated. Constructors and public methods cannot be declared as abstract.
Abstract Class a class that cannot be instantiated. It often appears at the top of an object-oriented programming class hierarchy, defining the broad types of actions possible with objects of all subclasses of the class
Abstract Methods methods in the abstract classes that do not have implementation public abstract void someMethod();
Abstract Class Coding Guidelines Use abstract classes to define broad types of behaviors at the top of an object-oriented programming class hierarchy, and use its subclasses to provide implementation details of the abstract class
Interfaces a special kind of block containing method signatures (and possibly constants) only.
Interfaces define the signatures of a set of methods without the body.
Interfaces define a standard and public way of specifying the behavior of classes. They allow classes, regardless of their location in the class hierarchy, to implement common behaviors.
Interface an abstract class that represents a collection of method definitions and constant values. It can later be implemented by classes that define the interface using the implements keyword.
Why use interface? We need to use interfaces if we want unrelated classes to implement similar methods. Thru interfaces, we can actually capture similarities among unrelated classes without artificially forcing a class relationship.
Why use interface? Another reason for using an object's programming interface is to reveal an object‘s programming interface without revealing its class Finally, we need to use interfaces to model multiple inheritance which allows a class to have more than one superclass.
Abstract vs Interface interface methods have no body, an interface can only define constants and an interface have no direct inherited relationship with any particular class, they are defined independently
Abstract vs Interface One common characteristic of an interface and class is that they are both types. This means that an interface can be used in places where a class can be used.
Abstract vs Interface You cannot create an instance from an interface.
Abstract vs Interface Another common characteristic is that both interface and class can define methods. However, an interface does not have an implementation code while the class have one.
Coding Guidelines: Use interfaces to create the same standard method definitions in may different classes. Once a set of standard method definition is created, you can write a single method to manipulate all of the classes that implement the interface
Relationship of an Interface to a Class a class can implement an interface as long as it provides the implementation code for all the methods defined in the interface
Relationship of an Interface to a Class a class can only EXTEND ONE super class, but it can IMPLEMENT MANY interfaces. public class Person implements PersonInterface,LivingThing,WhateverInterface
Inheritance on interfaces interfaces can have inheritance relationship among themselves. public interface StudentInterface extends PersonInterface {}
MODULE 8 M8
Exception denotes an abnormal event that occurs during the execution of the program and disrupts its normal flow
CONCEPTS OF EXCEPTION When an error occurs within a method, the method creates an object called exception object and hands it off to the runtime system.
CONCEPTS OF EXCEPTION Exception object contains information about the error, including its type and the state of the program when the error occurred.
CONCEPTS OF EXCEPTION Creating an exception object and handing it to the runtime system is called throwing an exception
CONCEPTS OF EXCEPTION After a method throws an exception, the runtime system attempts to find a list of methods, called the call stack to handle it
CONCEPTS OF EXCEPTION The runtime system searches the call stackfor a method that contains a block of code that can handle the exception called exception handler.
CONCEPTS OF EXCEPTION When an appropriate handler is found, the runtime system passes the exception to the handler.
CONCEPTS OF EXCEPTION The exception handler chosen is said to catch the exception. If the runtime system exhaustively searches all the methods on the call stack without finding an appropriate exception handler the runtime system terminates.
exception handler. An exception handler is considered appropriate if the type of the exception object thrown matches the type that can be handled by the handler
Exception-Handling Keywords Øtry Øcatch Øthrow Øthrows Øfinally
finally block The code in the finally block is always executed
Syntax of Exception (try-catch) • The block notation is mandatory. • For each try block, there can be one or more catch blocks, but only one finally block. • The catch blocks and finally blocks must always appear in conjunction with the try block, and in the correct order
Syntax of Exception (try-catch) A try block must be followed by at least one catch block OR one finally block, or both. Each catch block defines an exception handle. The header of the catch block takes exactly one argument, which is the exception its block is willing to handle.
Syntax of Exception (try-catch) The exception must be of the Throwable class or one of its subclasses.
Common Predefined Exceptions Common Predefined Exceptions
ArithmeticException thrown when an exceptional arithmetic condition occurred such as dividing integers by zero
NullPointerException thrown when an application attempts to use a null object that has not been initialized or instantiated
ArrayIndexOutOfBoundsException thrown when an attempt is made to access an element in the array that is beyond the index of the array
User-defined Exceptions creating steps 1. Create a class that extends from Exception. 2. In a method of another class, throw a new instance of the Exception. 3. Use the method that throws exception in a try-catch block
Assertions a statement in Java that enables you to test your assumptions about your program.
Assertions Each assertion contains a boolean expression that you believe will be true when the assertion executes
Assertions By verifying that the boolean expression is indeed true, the assertion confirms your assumptions about the behavior of your program, increasing your confidence that the program is free of errors.
Types of assertions Ø Pre-condition– an assertion which invokes when a method is invoked. Ø Post-condition– an assertion which invokes after a method finishes
When to use assertions Internal Invariants
When to use assertions Control Flow - If a program should never reach a point, then a constant false assertion may be used.
MODULE 9 M9
Collection The Collection in Java is a framework that provides an architecture to store and manipulate the group of objects
Java Collections can achieve all the operations that you perform on a data such as searching, sorting, insertion, manipulation, and deletion.
Java Collections means a single unit of objects.
Java Collection framework provides many interfaces and classes.
interfaces (Set, List, Queue, Deque
classes ArrayList, Vector, LinkedList, PriorityQueue, HashSet, LinkedHashSet, TreeSet
Collection represents a single unit of objects, i.e., a group.
framework Ø It provides readymade architecture. Ø It represents a set of classes and interfaces. Ø It is optional
Collection framework represents a unified architecture for storing and manipulating a group of objects Ø Interfaces and its implementations, i.e., classes Ø Algorithm
Iterable Interface the root interface for all the collection classes. it contains only one abstract method. i.e. iterator
Iterable Interface The Collection interface extends the Iterable interface and therefore all the subclasses of Collection interface also implement the Iterable interface.
Collection Interface the interface which is implemented by all the classes in the collection framework.
Collection Interface declares the methods that every collection will have. It builds the foundation on which the collection framework depends
methods of collection interface Boolean add ( Object obj), Boolean addAll ( Collection c), void clear(), etc.
List Interface the child interface of Collection interface.inhibits a list type data structure in which we can store the ordered collection of objects. It can have duplicate values.
List Interface implemented by the classes ArrayList, LinkedList, Vector, and Stack.
ArrayList implements the List interface.
ArrayList uses a dynamic array to store the duplicate element of different data types.
ArrayList class maintains the insertion order and is non-synchronized. The elements stored in the ArrayList class can be randomly accessed.
LinkedList implements the Collection interface.
LinkedList uses a doubly linked list internally to store the elements. It can store the duplicate elements.
LinkedList maintains the insertion order and is not synchronized. In LinkedList, the manipulation is fast because no shifting is required
Vector uses a dynamic array to store the data elements. similar to ArrayList but it is synchronized and contains many methods that are not the part of Collection framework
Stack is the subclass of Vector.
Stack implements the last-in-first-out data structure, LIFO
Stack contains all of the methods of Vector class and also provides its methods like boolean push(), boolean peek(), boolean push(object o), which defines its properties
Queue Interface maintains the first-in-first-out order. FIFO
Queue Interface can be defined as an ordered list that is used to hold the elements which are about to be processed.
Queue Interface Classes in queue interface includes: PriorityQueue, Deque, and ArrayDeque. All implements the queue interface
PriorityQueue implements the Queue interface. It holds the elements or objects which are to be processed by their priorities. PriorityQueue doesn't allow null values to be stored in the queue
Deque Interface extends the Queue interface. Elements can be removed from both sides.
Deque Interface Deque stands for a double-ended queue which enables us to perform the operations at both the ends
ArrayDeque implements the Deque interface. It facilitates us to use the Deque. ArrayDeque is faster than ArrayList and Stack and has no capacity restrictions
Set Interface present in java.util package. It extends the Collection interface. represents the unordered set of elements which doesn't allow us to store the duplicate items.
Set Interface We can store at most one null value in Set. Set is implemented by HashSet, LinkedHashSet, and TreeSet
Hashset implements Set Interface. It represents the collection that uses a hash table for storage. Hashing is used to store the elements in the HashSet. It contains unique items
Linked Hashset represents the LinkedList implementation of Set Interface. It extends the HashSet class and implements Set interface. It also contains unique elements. It maintains the insertion order and permits null elements
SortedSet Interface the alternate of Set interface that provides a total ordering on its elements. The elements of the SortedSet are arranged in the increasing (ascending) order.
SortedSet Interface provides the additional methods that inhibit the natural ordering of the elements.
TreeSet implements the Set interface that uses a tree for storage. Like HashSet, TreeSet also contains unique elements. However, the access and retrieval time of TreeSet is quite fast. Elements are stored in ascending order.
MODULE 10 M10
Java I/O (Input and Output) used to process the input and produce the output.
java.io package contains all the classes required for input and output operations
Java I/O (Input and Output) Java uses the concept of a stream to make I/O operation fast. We can perform file handling in Java by Java I/O API
Stream a sequence of data. a stream is composed of bytes. It's called a stream because it is like a stream of water that continues to flow.
3 automatically created stream Ø1) System.out: standard output stream Ø2) System.in: standard input stream Ø3) System.err: standard error stream
OutputStream Java application uses an output stream to write data to a destination; it may be a file, an array, peripheral device or socket
InputStream Java application uses an input stream to read data from a source; it may be a file, an array, peripheral device or socket.
OutputStream Class Java OutputStream class is an abstract class. It is the superclass of all classes representing an output stream of bytes. An output stream accepts output bytes and sends them to some sink
InputStream Class InputStream class is an abstract class. It is the superclass of all classes representing an input stream of bytes
Java FileOutputStream Class JavaFileOutputStream is an output stream used for writing data to a file
FileOutputStream vs Filewriter use FileOutputStream class when writing primitive values into a file, use FileWriter for character-oriented data. However, You can still write byte-oriented as well as character-oriented data through FileOutputStream class.
FileOutputStream class declaration Java.io.FileOutputStream
Java FileInputStream Class Java FileInputStream class obtains input bytes from a file. It is used for reading byte-oriented data (streams of raw bytes) such as image data, audio, video etc.
FileReader class You can also read character-stream data from FileInputStream. But, for reading streams of characters, it is recommended to use FileReader class
FileInputStream class declaration Java.io.FileInputStream
Java FileWriter Class used to write character-oriented data to a file . It is character-oriented class which is used for file handling in java
Java FileWriter Class Unlike FileOutputStream class, you don't need to convert string into byte array because it provides method to write string directly.
Java FileWriter Class declaration Java.io.FileWriter
Java FileReader Class used to read data from the file. It returns data in byte format like FileInputStream class
Java FileReader Class It is character-oriented class which is used for file in java
Java FileReader Class declaration Java.io.FileReader
NETBEANS MODULE 1 NETBEANS M1
Integrated Development Environment The Leaders: NetBeans-- Microsoft Visual Studio Eclipse a computer software to help computer programmers develop software
What does an IDE consist of Source code Editor. - Compiler and/or interpreter. - Build - automation tools
History of NetBeans started as a student project called Xelfi
History of NetBeans The Goal was to write a Delphi- like Java IDE in Java for the first time
History of NetBeans The original plan was to develop network-enabled JavaBeans components, hens the name. but coming out of the spec for enterprise changed the plans
History of NetBeans Sun decided it needs a more powerful Java development tool, and the rest is history
NetBeans A fast fully-featured Integrated Development Environment (IDE) with support for Java
NetBeans Provides an open source, high performance, modular, extensible, multi-platform Java IDE for GUI, mobile tools, Web, and Desktop applications. Written in java and therefore runs on every operating system that supports Java VM
Environment easily configured user interface and a modular architecture extensible with additional plugins.
Project System support for multiple source roots, easy management of libraries, easily ported to other environments, all based on Apache Ant
Web Development: Web Application project type, Supports the J2EE 1.3 and 1.4 standards with web application build support based on Apache Ant
Enterprise Java Beans (EJB) Development: easy to create and deploy and import java beans.
Web Services Development: wizards for creating web services and web services clients, providing the basic (java/wsdl) code needed, and easy to use testing tools of existing web services
Java 2 Platform, Micro Edition (J2ME) MIDP development: visual design editor with end-to-end support for enterprise applications
Code Editor Syntax highlighting for Java, XML, HTML, CSS, JSP and IDL, full support of new JDK 1.5 features, live parsing/error marking, popup javadoc, code completion, and fast class importing
Refactoring: renaming, changing and moving of various objects, field encapsulation and usage finding
Award Winning Debugger: Language independent debugger core, variable modification and watches, various breakpoints and “Fix and Continue” mechanism.
GUI Builder: fully WYSIWYG designer with "Test Form" feature, extensible Component Palette pre-installed Swing and AWT components, showing a components tree and properties, automatic code generation and full JavaBeans support
Version control Support: s supports command lined vcs, supplying merging and diff tools and containing a built- in CVS client
XML: XML, DTD and CSS Text Editor and XML Productivity Tools Wizards to help user generate codes.
NetBeans Profiler provides information about the runtime behavior of applications. Allows developers to monitor the thread state, CPU performance, and memory usage of their applications. makes it easy to track down performance problems and memory leaks.
NetBeans Platform: provides the services common to almost all large desktop applications such as: window, menu, settings management and storage, file access and more.
NetBeans Mobility Pack allows for the unique “On-Phone” debugging mode used to write, test, and debug applications for the Java Micro Edition platform (J2ME) technology-enabled mobile devices. It integrates support for the Mobile Information Device Profile (MIDP) 2.0.
NetBeans Matisse The biggest improvement from the previous version and the feature with the biggest impact is the new GUI- Builder, Matisse
NetBeans Matisse The Goal: to take the best features from OSX and VS designers and allow the same possibilities for Java Programmers
NetBeans Matisse In order to reach that goal there was a need to develop a new layout manager to support all the needed functionalities
NetBeans Matisse Matisse provides a simple and intuitive layout of GUIs without having to understand the complexities of Swing layout managers.
NetBeans Matisse As you drag and drop components into a form, the IDE automatically suggests alignment, spacing, and resizing constraints.
NetBeans Matisse By simply right clicking a UI Object you can add an event handler with a method waiting to be implemented without knowing too much about the surrounding of this object. (watch example clip in the site
NetBeans Matisse Supports internationalization, and industrial look-and-feel rules, which is very important for large scale application meant to be spread world wide
NetBeans Matisse Builds also GUI web applications, HTML, JSP, etc
NetBeans Matisse - Disadvantages No built-in support for Drag-n-Drop or double-click events.
NetBeans Matisse - Disadvantages Matisse’s code is protected so customizing is not very easy and not always possible
NetBeans Matisse - Disadvantages Not all applications are easily built. For instance, an MDI Project is not that trivial to build
Created by: palpakan56
 

 



Voices

Use these flashcards to help memorize information. Look at the large card and try to recall what is on the other side. Then click the card to flip it. If you knew the answer, click the green Know box. Otherwise, click the red Don't know box.

When you've placed seven or more cards in the Don't know box, click "retry" to try those cards again.

If you've accidentally put the card in the wrong box, just click on the card to take it out of the box.

You can also use your keyboard to move the cards as follows:

If you are logged in to your account, this website will remember which cards you know and don't know so that they are in the same box the next time you log in.

When you need a break, try one of the other activities listed below the flashcards like Matching, Snowman, or Hungry Bug. Although it may feel like you're playing a game, your brain is still making more connections with the information to help you out.

To see how well you know the information, try the Quiz or Test activity.

Pass complete!
"Know" box contains:
Time elapsed:
Retries:
restart all cards