Category Archives: Java

Java learned as so far:

Java variables,
Array, 2d array
Method
Different method invoking and return type
Class
– Class is actually a blueprint/specification/design
– A class can create as many as objects it needs to create
Object
– Earth is a software application where human and other thing is software objects.For creating object we need to create a human class
– Objects do particular behavior in a class
– Object exist only in application runtime actually when application is running
– Objects have identity,state and behavior

this keyword – it represent current object
Instance
Constructor – The costructor is a special method with the same name as the class and it’s used to instantiate objects from that class
– Every class has a by default constructor if we don’t put it manually
– The constructor is special method containing instructions for object creation. it can be said it is so called birth method. It has instructions for how the object will be born when the application starts up
Static keyword
Stack and heap memory
Garbage collection
Object oriented Programming = better organizing of code, it is a way to organize our code from multiple files by creating objects
Local variable
Reference variable
Instance variable
Inheritance
– Inheritance is the approach to get/transfer behaviour of one class to another
– We use extends keyword for inheriting, in inheritance we inherit from parent class which known as base class and the class which needs inheritation is known as child class or sub class/derived class
super keyword it extract constructor and it’s variable from parent class but reverse is not possible
Overrides
– Same method name with different purpose
– Same method name in parent class but in child class the method name is same but with different purpose
– Overrides means replace
– Override is not a good idea sometimes so we go for interface
Interfaces
– Interface is a contract with a class. The class needs to implements that method of the interface according to contract
– Interface has a method which does not need body, so it is just only to define, it is called as abstract method
– one parent class
– We use implements keyword while putting interface in a class
Abstract class
– When you don’t need all methods to invoke you can use abstract method, you can not make object from abstract class. Abstract method needs to be in abstract class. We use abstract keyword for both method and object to define abstract class and methods
– you can only extend abstract class but can not instantiate abstract class
– We can define abstract class as a type while creating object
Polymorphism

Loops
Exception Handling

Collection Framework
Wrapper class
Threading
Concurrency
Database

Jshell
Functional Interfaces
Lambda expressions

-Lambda helps us to use separate from associated object
– it can run without class
– We need to use lot of interfaces for this

Streams

Ei bold kora jayga diye project banaye banaye clear korte hobe
Italic kora jaygagula motamuti clear asey In Sha Allah, Alhamdulillah
The source is : Imtiaz Ahmed’s complete Java course

 

Master Object Oriented Design in Java course note

Association: It defines relationship between classes, it defines how the software will behave
Dependency Association: For example from code:

A driver receives a vehicle reference only as driver then only he can drive or accelerate

Composition: A particular object . It imply ownership
for example in this code:

Aggregation Association: It does not imply ownership

Here Department to SpanishCourse relation is composite

But Course to Student relationship is not composite because it does not imply ownership a student can take many courses or not

We find this relationship from above diagram, the block diamond and white diamond is the part of UML diagram

Forming Association between objects:

has a relationship in customer .

Now when to stop delivery

Overview of software design:
For example: Hospital Employee Management System
Task of the software:
Hire and Terminate Employees
Print Reports(XML,CSV Formats)

Problem Statement:
Current status of the software

Tips for design:
– You must draw design in paper or whiteboard don’t go to code directly
– Don’t overdesign or overdraw
– We have to develop iteratively but early steps should be kept simple
– Class names should be nouns based on their intention

Single Responsibility Priniciple(SRP): Not all the things in the same class

Don’t repeat yourself(DRY):

Arrow sign always describe that it is depends on that dependency class:

 


DAO=Data Access Object

Single Responsibility Principle Special Notes:
A class should have only one single reason to change

 

Open closed principle sayings about class design:

Classes should be open for extension but closed for modification.

Open Closed Principle and Strategy pattern:
Software modules should be open for extension and closed for modification
In development lifecycle software requirements needs to be constantly pour in. If developed need to change the already made codes the design is fragile. Fragile means broken.

So open closed principle save engineers from fragile design

instanceof operator we used here in the code:
HotelManagementSystem class:

Here it is like a junk drawer

So we will make it changes because it is violating OCP principle. This chamging process is known as Strategy pattern. So let’s do it.

We could also do it with interface class except abstract class

Example after applying Strategy pattern:
Nurse.java

Doctor,java

HospitalManagement.java

 

Employee.java

 

EmergencyRoomProcess.java

To String Tutorial:

DemoToString.java

Dependency Inversion Principle:
Device Manufacturing Company has:

The manufacturing process:
1. Assembly
2. Testing
3. Packaging
4. Storage

GeneralMAnufacturingProcess
UML diagram:

We depend on something in driving like car is stopping by traffic light
Imagine a life every car has different mechanism
Violation of Dependency Inversion Principle
When higher level modules depend on lower level ones succeptible to change
Dangers of coupling:
Tight coupling :

Well design software has single responsibility
This method says high level modules should not depend on lowlevel modules. It should depend on abstractions
Abstract classes and Interfaces don’t change as often as concrete classes/ derivatives
Cohesion means related things together.

This code I tried to run in class inside class but did not worked. Then I downloaded course code and run worked then again I tried to do with my directory structure then it worked.

Quizes from OOP course:
Q1:
Q2: The Dependency Inversion Principle states
Interfaces and abstract classes change far less often the concrete derivatives. Concrete classes should depend on Interfaces and abstract classes because they change less often and are higher level modules

Q3: In general the dependency inversion principle states that code should only depend on things that don’t change often
True
Liskov Substitution Principle:
Subtypes must be substitutable for their basetypes

There are some patterns which is not good known as Anti-pattern:
Here the link can be found


This is a ISA relationship, Nurse and Doctor depends on Employee class. Employee class is Abstract class

When it is adding a substitute teacher who does not work as like a teacher it violates the LISKOV pronciple as per this line of definition: Subtypes must be substitutable for their basetypes

So we changed to a new UML which does not violate LISKOV principle and did the code.

New UML:


Question 1:
The Liskov Substitution principle states, that child classes should not be substitutable in place of their parents.

Interface Segregation Principle:

Fat class is a class which has too many responsibilities.

CustomerTransaction

From Quiz: Main Kotha about Interface Segregation Principle:

This principle does not have to do with the number of dependencies that may exist in an application. The principle simply states that modules should not have dependencies on code they do not use.

If a module does not use functionality from another module, there is no reason to have a direct dependency between them. There should be an abstraction in between to segregate the 2 modules

Dependency Injection: 
When the application is not running there is no object because onbject only available in runtime, you will find only some classes

Tight Coupling:
Cohesion:
A very popular dependency injection implementation is spring framework bundled with spring container.

Dependency injection is

Dependency Injection Using Spring:
Observer Pattern:
The observer pattern is a software design pattern in which an object, called the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods.

One basic UML diagram from wikipedia:

Created one for the course:

Builder Pattern:
When there is so many constructors and tough to handle it. Example codes with some bugs. Will do the solution later.

code example:
user.java

app.java

Factory Pattern:

UML Diagram:

codes:
Vehicle.java

VehicleFactory.java

App.java

VehicleType.java

ElectricCar.java

Car.java

Truck.java

Singleton Design Pattern: It only uses once in an application.

PerformanceStage

Application.java

 

 

Course Source Imtiaz Ahmed Master OOP Design udemy course
Best Book Rereference/Website reference for learning Java: https://beginnersbook.com/2013/12/java-string-equals-and-equalsignorecase-methods-example/

Static keyword java explanation

Some of the concepts learn from this video:

 

and this blog post

Java – Static Class, Block, Methods and Variables

 

This blog site can be seen for future references:

Head First Java Chapter 10 Notes

Java Programming Recap In Sha Allah

OOP concept clearings from some MOOC courses

Code:

Student.java

 


 

StudentTest.java

 

 

 

Started My Java Revise and Python Learning

Need to revise everything.

Java vs C# Similarity

https://www.harding.edu/fmccown/java_csharp_comparison.html

BigInteger in Java and C++

code:

for c++ this link link or google search is good but i didn’t found any goood solution yet:
http://codeforces.com/blog/entry/16380

java:

Simple addition:

BigInt Sum:

 

 

If will do about Java Certification later

Guideline:
https://www.quora.com/How-do-I-pass-OCA-OCP-7-and-8-exam
https://www.quora.com/Is-Java-SE8-OCA-exam-really-hard

Java Jobs

Java Developer

Precima 4.3 23 Reviews – Toronto

Job Description

About us

LoyaltyOne is part of the successful Alliance Data family of companies that provide the full range of data-driven loyalty, marketing and credit solutions in more than 80 locations across the globe.

Working with more than 100 leading brands in the retail, financial services, grocery, petroleum retail, travel and hospitality industries to profitably change customer behavior. Through a team of businesses, including one of the leading coalition loyalty programs in the world, the AIR MILES Reward Program, LoyaltyOne designs, delivers and manages a suite of services focused on consumer data, customer-centric retail strategies, direct-to-consumer marketing, loyalty consulting and more.

Furthermore, LoyaltyOne has broadened their horizons geographically by growing Precima in the European market. With the recent acquisition of BrandLoyalty in the Netherlands they have gained the expertise of a global leader in short-term loyalty campaigns, along with a client network that extends throughout Europe and Asia.

Precima applies shopper insights derived from advanced analytics to help retailers and manufacturers drive sales growth and boost profitability. Using comprehensive fact bases of purchase data, their team of experts help improve marketing and merchandising by identifying opportunities for growth and align both internal teams and external partners to best meet shoppers’ needs.

Precima tailors the scope and pace of its solutions to the unique priorities of each client. The overall goal is to achieve not just tactical wins but long term strategic gains, encouraging retailers to broaden the marketing agenda and fully explore the potential of sophisticated shopper insights.

Their roster of past and current clients includes many leading Fortune 1000 brands, among them some of the top high-frequency retailers in North America. Backed by first-hand experience with leading retail and manufacturing organizations, the Precima team brings a remarkable blend of expertise in loyalty, analytics, marketing and management to help you make more informed and profitable business decisions.

Learn more about Precima at http://www.precima.com

About the role
Come grow with Precima! We are looking for a Web Services developer who will help us to build the future for Precima’s embedded analytics platform. This is a highly technical position in an exciting new development area we will be introducing into our retail analytics business platform. We are looking for you to help implement our web platform. You will be a key team player and an integral part of our awesome web services team.
Who you are:
  • You bring a positive energy to the team and thrive on strong collaboration.
  • You are someone others look to for solving difficult problems, bounce ideas off and providing an alternate viewpoint.
  • You are self motivated and thrive on developing solutions to open-ended business problems.
  • You believe in developing great user experiences, through application flow and front end design.
  • Have 1-3 years of developing end to end web solutions
  • Have a Bachelor Degree in Computer Science, Computer Engineering, Electrical Engineering or other related discipline
Why we need you:
  • You will develop standard web solutions for industry leading interactive retail analytics
  • Participate in defining backlog and requirements clarification for various web projects
  • Help us to research and take advantage of new technology to improve and expand solutions
  • Leverage your previous experience to develop software solutions in support of business requirements and in accordance with predetermined software solution design standards
  • You are confident participating in an agile environment on design, development, testing and implementation of web solution components and modules
  • Troubleshoot and correct software defects
  • Participate in peer code reviews
What we use:
  • Java and corresponding development frameworks such as Spring
  • HTML5, CSS3, JSON
  • Bootstrap, LESS, SASS
  • Javascript – jQuery, Angular2, ReactJS, Node.js
  • Database experience (Relational) – MySQL, Oracle
  • Tomcat
  • Git
  • Atlassian tools – BitBucket/Stash, JIRA, Confluence, Bamboo
Nice to have:
  • Visualization library experience – D3.js, Google Charts, QlikSense
  • IIS
  • Cloud deployment experience; preference for Amazon Web Services stack
  • Big Data, Data Warehousing, In-Memory Database experience
Perks of our company:
  • High impact role with interesting challenges and huge growth potential!
  • Flexible hours and strong work life balance
  • Free Starbucks coffee and lattes, subsidized catered bistro café
  • On-site gym and massage therapy – great health and wellness benefits
  • Located directly above St. Patrick Subway station
  • One of the highest performing companies in the market (NYSE: ADS)
  • One of the 50 Best Employers in Canada – we value our employees!
Interested? Learn more about Precima at precima.com. If you think you are ready to help us drive the web services team forward apply and we will review your resume!

Alliance Data is an Equal Employment Opportunity employer. Accordingly, we will make reasonable accommodations to respond to the needs of people with disabilities in accordance with legislation.

Alliance Data participates in E-Verify

JAVA/ J2EE Web Developer

A Leading Multinational Company

Job Description / Responsibility
  • Perform all phases of software engineering including requirements analysis,application design, code development and testing
  • Design and implement product features
  • Design reusable components, frameworks and libraries
  • Participate in an Agile / Scrum methodology to deliver high – quality software
  • Design and develop innovative solutions to meet the needs of the business
  • Review code and provide feedback relative to best practices and improving performance
  • Troubleshoot production support issues post deployment and come up with solutions as required
Job Nature

Full-time

Educational Requirements
    Bachelor Degree or above in Computer Science/ Engineering/ MIS or relevant degree from reputed institution is required.
Experience Requirements
  • At least 3 year(s)
Job Requirements
  • Very good written and spoken english.
  • 3+ years of application development experience
  • Experience delivering web – based technology and Integration solutions to meet business needs
  • Hands on experience with Java/ J2EE, Spring, Hibernate, Apache, MySQL, GitHub, Java 8, Maven, HTML/CSS, Javascript/Jquery
Job Location

Dhaka

Salary Range
    Negotiable
Job Source

Bdjobs.com Online Job Posting

Job Summary

Published on: Mar 14, 2017

Job Nature: Full-time

Experience: At least 3 year(s)

Job Location: Dhaka

Salary Range: Negotiable

Application Deadline: Apr 13, 2017

Courses from Bdjobs Training

Pay online and get 10% discount

or
Send your CV to [email protected] or Click here to Email CV from MY BDJOBS account.
If you think, you are the right person for the job, please apply with complete resume at [email protected]

Applicant must enclose his/her Photograph with CV.

Application Deadline : Apr 13, 2017

Java Certification Experience

https://coderanch.com/t/657812/certification/Passed-today

Java vs PHP developer as Career

https://www.quora.com/Which-is-better-a-career-as-a-PHP-developer-or-as-a-Java-developer

First of all think that what do you want to do? A career or just a task? If you want to get money in your career choose java and spend years to stay in this field. But if you want quick earning money and complete projects in one or two days choose PHP. Never think that if something is hard and tricky then you must go to that way but think that what others are doing and where others are rushing to? – Arshad Hussain Dec 26 ’13 at 18:59

http://stackoverflow.com/questions/20789577/i-am-confused-about-j2ee-and-php

Data Mining:Intros and Weka With Java

https://www.ibm.com/developerworks/library/os-weka1/

http://www.programcreek.com/2013/01/a-simple-machine-learning-example-in-java/

http://www.cs.umb.edu/~ding/history/480_697_spring_2013/homework/WekaJavaAPITutorial.pdf

Advanced string manipulation

Actually we use this method to split string from a big sentence using regex.

String Manipulation

Java OOP Examples

https://www.ntu.edu.sg/home/ehchua/programming/java/J3a_OOPBasics.html

Triangular Number Java Code True or False

Here yo can see what is triangular number:

https://en.wikipedia.org/wiki/Triangular_number