Welcome!

AJAX & REA Authors: David H Deans, Carmen Gonzalez, Pat Romanski, Aria Blog, Lori MacVittie

Related Topics: Java, AJAX & REA

Java: Article

Learn Java in 10 Minutes

Basic Java Tutorial

What is Java?
You can find tons of definition about Java on web; my answer is simple “Programming Language to develop any kind of application with Object Oriented approach and it can run anywhere”.

Sample application
For example, you need to develop an application to track your daily expenses on your PC. The application can be developed by Java by the following manner.

Minute 1 Session
First download and install Java Development Kit (JDK) from official Oracle site. The JDK is the software environment where you can compile and run your Java programs.  Download here.

Minute 2 Session
Know the commands to compile and run a Java program.  Before that you need to set the path to point your Java compiler on your development location. Assume that you have installed JDK on your C:\Program Files\Java\jdk1.7.0 drive. You need to run the following line of code in your command prompt before accessing Java compiler.
SET PATH = C:\Program Files\Java\jdk1.7.0\bin;
Open start menu and type cmd on your Windows machine to open command window.  Now open your folder where your Java programs are saved.

For example: D:/MyJava.
Cd  D:/MyJava
D:MyJava > SET PATH = C:\Program Files\Java\jdk1.7.0\bin;


Note that “jdk1.7.0\bin” folder contains Java compiler (javac) and Java interpreter (java) applications.
Now you are ready to run a sample Java program on your machine. Unlike like regular hello world application, we are going to run a practical program to track daily expenses.

Minute 3 Session
Just learn about simple Java program and know the basic steps to compile and run a program.
A Java class is a blueprint of an object. An object in an instance of a class.

Step1: Identify Java classes
Step2: Develop Java classes
Step3: Develop main class
Step4: Compile all classes
Step5: Run main class

Main class is a Java class which has interpreter calling method named main like below:

public void main(String args[]){ // main method to run a Java program
// Code to call other objects/classes
}


Minute 4 Session
In our case, we need to develop an application for daily expense tracking. The following classes may satisfy these requirements.
ExpenseTracker
ExpenseTrackerMain


Minute 5 Session
Develop ExpenseTracker Java class.

public class ExpenseTracker {

public void addExpense(String expenditure, double amount){
System.out.print(“Expenditure ”+ expenditure+”  “+amount+” added on ”+new java.util.Date());
}

}


Save this file as ExpenseTracker.java in your working folder.


Minute 6 Session
Develop ExpenseTrackerMain class to run this application.

public class ExpenseTrackerMain {

public static void main(String as[]){
ExpenseTracker tracker = new ExpenseTracker();
String expen = JOptionPane.showInputDialog(null, “Expenditure”);
String amount = JOptionPane.showInputDialog(null, “Amount”);
Double doubleAmount = Double.parseDouble(amount);
tracker.addExpense(expen, doubleAmount);
}

}

Minute 7 Session
Compile your application.  Just open your working directory where you saved these .java files and follow the below steps.
Open command prompt and go to your working directory.

Type SET PATH = C:\Program Files\Java\jdk1.7.0\bin; // recall Minute 2 session
Type javac *.java
This command will compile both ExpenseTracker and ExpenseTrackerMain Java files. This action will generate .class files inside your working directory.

Minute 8 Session
Run your application.
Open command prompt and go to your working directory.
Just type java ExpenseTrackerMain in your command window.

Minute 9 Session
Your first Java program is done.
What is next?
Just add some methods in ExpenseTracker Java file, call those methods in ExpenseTrackerMain class, compile and run again.

Minute 10 Session
Similar to Expense Tracker application develop Task Tracker application by using the following code snippet.

public void addTask(String task, Status status){
System.out.print(“Task ”+ task +”   added on ”+new java.util.Date()+”.  Status of this task is :”+status);
}


What is next?
One of the best ways to develop your Java knowledge is by Oracle’s Java Certification program. There are numerous vendors available to teach Java in the world but there are few vendors are having good knowledge and latest updates.

You can find best Java Certification Training Labs from EPractize Labs,  leading Java Certification Preparation website for all Oracle’s certifications including latest Java 7 and Java EE 6 OCE certifications.

The following Training Labs teach beginner to expert level in Java 7 programming.
1Z0-803 - Oracle Certified Associate, Java SE 7 Programmer  -  Java SE 7 OCA Training Lab
1Z1-804 - Oracle Certified Professional, Java SE 7 Programmer - Java EE 7 OCP Online Training

More Stories By Kenrick Freemen

Kenrick Freemen is a software architect doing consulting for banking and education domains. He has more than 6 years of experience in developing Java EE applications. He is a Sun Certified Java Programmer, Oracle Certified Professional, Java EE 5 Web Services Developer and Sun Certified Java EE Architect.

@CloudExpo Stories
Cloud services are the newest tool in the arsenal of IT products in the market today. These cloud services integrate process and tools. In order to use these products effectively, organizations must have a good understanding of themselves and their business requirements. In his session at 15th Cloud Expo, Brian Lewis, Principal Architect at Verizon Cloud, will outline key areas of organizational focus, and how to formalize an actionable plan when migrating applications and internal services to...
Once the decision has been made to move part or all of a workload to the cloud, a methodology for selecting that workload needs to be established. How do you move to the cloud? What does the discovery, assessment and planning look like? What workloads make sense? Which cloud model makes sense for each workload? What are the considerations for how to select the right cloud model? And how does that fit in with the overall IT tranformation? In his session at 15th Cloud Expo, John Hatem, head of V...
SYS-CON Events announced today that ElasticBox is holding a Hackathon at DevOps Summit, November 6 from 12 pm -4 pm at the Santa Clara Convention Center in Santa Clara, CA. You can enter as an individual or team of up to 10 developers. A New Star Is Born Every Month! All completed ElasticBoxes will then be sent to a judging panel - 12 winners will be featured on the ElasticBox website in 2015. All entrants will receive five full enterprise licenses for one year + ElasticBox headphones + Elasti...
SAP is delivering break-through innovation combined with fantastic user experience powered by the market-leading in-memory technology, SAP HANA. In his General Session at 15th Cloud Expo, Thorsten Leiduck, VP ISVs & Digital Commerce, SAP, will discuss how SAP and partners provide cloud and hybrid cloud solutions as well as real-time Big Data offerings that help companies of all sizes and industries run better. SAP launched an application challenge to award the most innovative SAP HANA and SAP ...
Ixia develops amazing products so its customers can connect the world. Ixia helps its customers provide an always-on user experience through fast, secure delivery of dynamic connected technologies and services. Through actionable insights that accelerate and secure application and service delivery, Ixia's customers benefit from faster time to market, optimized application performance and higher-quality deployments.
SYS-CON Events announced today that Calm.io has been named “Bronze Sponsor” of DevOps Summit Silicon Valley, which will take place on November 4–6, 2014, at the Santa Clara Convention Center in Santa Clara, CA. Calm.io is a cloud orchestration platform for AWS, vCenter, OpenStack, or bare metal, that runs your CL tools puppet, Chef, shell, git, Jenkins, nagios, and will soon support New Relic and Docker. It can run hosted, or on premise and provides VM automation / expiry, self-service portals,...
In her General Session at 15th Cloud Expo, Anne Plese, Senior Consultant, Cloud Product Marketing, at Verizon Enterprise, will focus on finding the right mix of renting vs. buying Oracle capacity to scale to meet business demands, and offer validated Oracle database TCO models for Oracle development and testing environments. Anne Plese is a marketing and technology enthusiast/realist with over 19+ years in high tech. At Verizon Enterprise, she focuses on driving growth for the Verizon Cloud pla...
SYS-CON Events announced today that Aria Systems, the recurring revenue expert, has been named "Bronze Sponsor" of SYS-CON's 15th International Cloud Expo®, which will take place on November 4-6, 2014, at the Santa Clara Convention Center in Santa Clara, CA. Aria Systems helps leading businesses connect their customers with the products and services they love. Industry leaders like Pitney Bowes, Experian, AAA NCNU, VMware, HootSuite and many others choose Aria to power their recurring revenue bu...
The Internet of Things (IoT) is going to require a new way of thinking and of developing software for speed, security and innovation. This requires IT leaders to balance business as usual while anticipating for the next market and technology trends. Cloud provides the right IT asset portfolio to help today’s IT leaders manage the old and prepare for the new. Today the cloud conversation is evolving from private and public to hybrid. This session will provide use cases and insights to reinforce t...
As Platform as a Service (PaaS) matures as a category, developers should have the ability to use the programming language of their choice to build applications and have access to a wide array of services. Bluemix is IBM's open cloud development platform that enables users to easily build cloud-based, creative mobile and web applications without having to spend large amounts of time and resources on configuring infrastructure and multiple software licenses. In this track, you will learn about the...
Blue Box has closed a $10 million Series B financing. The round was led by a strategic investor and included participation from prior investors including Voyager Capital and Founders Collective, as well as the Blue Box executive team. This round follows a $4.3 million Series A closed in December of 2012 and led by Voyager Capital. In May of this year, the company announced general availability of its private cloud as a service offering, Blue Box Cloud. Since that release, the company has dem...
SYS-CON Events announced today that Verizon has been named "Gold Sponsor" of SYS-CON's 15th International Cloud Expo®, which will take place on November 4-6, 2014, at the Santa Clara Convention Center in Santa Clara, CA. Verizon Enterprise Solutions creates global connections that generate growth, drive business innovation and move society forward. With industry-specific solutions and a full range of global wholesale offerings provided over the company's secure mobility, cloud, strategic network...
SimpleECM is the only platform to offer a powerful combination of enterprise content management (ECM) services, capture solutions, and third-party business services providing simplified integrations and workflow development for solution providers. SimpleECM is opening the market to businesses of all sizes by reinventing the delivery of ECM services. Our APIs make the development of ECM services simple with the use of familiar technologies for a frictionless integration directly into web applicat...
The only place to be June 9-11 is Cloud Expo & @ThingsExpo 2015 East at the Javits Center in New York City. Join us there as delegates from all over the world come to listen to and engage with speakers & sponsors from the leading Cloud Computing, IoT & Big Data companies. Cloud Expo & @ThingsExpo are the leading events covering the booming market of Cloud Computing, IoT & Big Data for the enterprise. Speakers from all over the world will be hand-picked for their ability to explore the economic...
Cloudwick, the leading big data DevOps service and solution provider to the Fortune 1000, announced Big Loop, its multi-vendor operations platform. Cloudwick Big Loop creates greater collaboration between Fortune 1000 IT staff, developers and their database management systems as well as big data vendors. This allows customers to comprehensively manage and oversee their entire infrastructure, which leads to more successful production cluster operations, and scale-out. Cloudwick Big Loop supports ...
To manage complex web services with lots of calls to the cloud, many businesses have invested in Application Performance Management (APM) and Network Performance Management (NPM) tools. Together APM and NPM tools are essential aids in improving a business’s infrastructure required to support an effective web experience… but they are missing a critical component – Internet visibility. Internet connectivity has always played a role in customer access to web presence, but in the past few years use...
SAP is delivering break-through innovation combined with fantastic user experience powered by the market-leading in-memory technology, SAP HANA. In his General Session at 15th Cloud Expo, Thorsten Leiduck, VP ISVs & Digital Commerce, SAP, will discuss how SAP and partners provide cloud and hybrid cloud solutions as well as real-time Big Data offerings that help companies of all sizes and industries run better. SAP launched an application challenge to award the most innovative SAP HANA and SAP ...
Software AG helps organizations transform into Digital Enterprises, so they can differentiate from competitors and better engage customers, partners and employees. Using the Software AG Suite, companies can close the gap between business and IT to create digital systems of differentiation that drive front-line agility. We offer four on-ramps to the Digital Enterprise: alignment through collaborative process analysis; transformation through portfolio management; agility through process automation...
What are the benefits of using an enterprise-grade orchestration platform? In their session at 15th Cloud Expo, Jeff Tegethoff, CEO of Appcore, and Kedar Poduri, Senior Director of Product Management at Citrix Systems, will take a closer look at the architectural design factors needed to support diverse workloads and how to run these workloads efficiently as a service provider. They will also discuss how to deploy private cloud environments in 15 minutes or less.
Headquartered in Santa Monica, California, Bitium was founded by Kriz and Erik Gustavson. The 1,500 cloud-based application using Bitium’s analytics, app management, and single sign-on services include bug trackers, customer service dashboards, Google Apps, and social networks. The firm states website administrators can do multiple tasks online without revealing passwords. Bitium’s advisors include Microsoft’s former CMO and the former senior vice president of strategy, the founder and CEO of Li...