Você está na página 1de 4

5 Days

1.
2.
3.
4.
5.
6.
7.
8.
9.

Java Introduction
Operators and Control Flows.
Classes and Objects (OOPS)
Exception handling.
Intro to Collections.
Strings
JDBC
XML and Webservices
Intro to SOA

Jdeveloper 12c - jdk -1.7 /1.8


12.2.12
jdev12c/jdev12c/
========================================================
Oracle Cloud
SaaS
Paas
IaaS
DEMON Thread -- Garbage Collector
=========================================================
START:
Jdeveloper
First create a Application - That will create .jws file
Then Project - That will create .jpr files
Then Files
Application Name : JavaTrainingApp
Directory
: C:\JDeveloper\mywork\JavaTrainingApp
Application Package Prefix : com.hitachi.training.java
>> Next
Project Name: Day1
Directory : C:\JDeveloper\mywork\JavaTrainingApp\Day1
>> Next
Default Package : com.hitachi.training.java
Java Cource Path : C:\JDeveloper\mywork\JavaTrainingApp\Day1\src
Output Directory :C:\JDeveloper\mywork\JavaTrainingApp\Day1\classes
>> FINISH
To check JDK > Right click on project and go to Project Properties > go to Libra
ries and Class Path
Create Java Class file
Right Click > New Class Files
JAVA CLASS:
Name: HelloWorld
package : com.hitachi.training.java.basics

Extends: java.lang.Object
Make sure to CHECK MAIN Method.
>> OK
SOP CTL+ENTER - (System.out.println("Hello World");)
Right Click , and click on RUN > Which will compile and execute
================== Classes and Objects (OOPS) ==============================
1.
2.
3.
4.

Inheritance
Polymorphism
Encapsulation
Abstraction

Class Employee {
emp_id,name,netpay,loans;
calBasic()
calAllow()
calInterest()
}
Prototype
Defines the structure
data + operations
=========
CLASS
=========
Class in a User defined data Type.
eg: HelloWorld is a Class
=========
OBJECT
=========
Object is instance of the class.
==================
Encapsulation
==================
Binding data and operations together.
==================
Polymorphism
==================
Many forms
In java we can create more than one function with the same name, but signatures
(number of parameters and datatype) should be different.
==================
Inheritance
==================
Reusability
Relationship:
- Has a relationship

- Is a relationship(Inheritance) - by creating a object


- Is a - Generalization and specialization.
==================
Java Classes :
==================
Simple / Single
Hierarchical
Hibrid
=========================== DAY2 ========================================
package<package name>;
import packagename.*;
import packagename.classname; (This is required as only the required classes are
loaded into JVM)
public class <Classname>
{
declare instance and class variables;
int id;
char code;
String fname,lname; // S is captal as its a class name
constructor(){
}
publict <returntype> <methodname> (parameters){}
public void displayDetails()
{
}
public int returnDiscount(int amount){
return 10;
}
public String getFullName (String fname, String lnamme)
{
return fullname;
}
public stati
}
==================================
System.out.println();
System is a class
================================
Access Modifiers and specifiers

================================
public
private
protected
default
final
static

- to declare constant
- shre memory
creates class variables
can be accessed without creating object
loads into memory as soon as pclasses loads
static methods can access only static variables directly.

abstract - Inheritance
Class and methods
Abstract and final cannot be used together
abstract method cannot have a body
abstract class cannot be instantiated
if any class having a even one abstract method class mus
t be declared as abstract.

Polymorphism
1. Overloading
Write a class to have 4 mothods with add to add int,float,double and string.
2. Overriding - Inheritance
Same function name and same signiture is called overriding.
Constructor
This - always refers to the current class.
super - Immediate super/parent class
/
=========================== Day 3 ============================
Can we make a variable private and final?
Yes , we can make. it will be private to that class and the value assigned to th
e variable will be constant.
Class implements interface.
================= Day 4 ===================
Create a main method with
assign some non zero values
divide two numbers and display the result.
Exception Handling
Creating custom /user defined exceptions.
Any java class extends exception or sub class exception becomes an exception cla
ss.

Você também pode gostar