Write your first Java program | John Singh | Skillshare

Playback Speed


  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Write your first Java program

teacher avatar John Singh, Senior Systems Analyst

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

4 Lessons (13m)
    • 1. Course Overview

      1:44
    • 2. Lesson 1 Downloading and installing the JDK

      2:22
    • 3. Lesson 2 Java Program Creation Theory

      3:09
    • 4. Lesson 3 Creating, compiling and running your program

      5:43
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

169

Students

--

Projects

About This Class

Welcome Everyone !! Java is one of the most popular programming languages on this planet. Java is used for application development, web development and for mobile devices, the Android operating system used on phones has strong similarities to Java.  This course quickly teaches the user how to write their first java program. It is very practical and does not waste time on too much theory. All that is needed is a text editor like notepad. It is not necessary to download Eclipse or Netbeans which are Integrated Development Environments for Java.

The course covers the installation of java, some program creation theory and a practical lesson on writing your first program. The student will not need programming knowledge but you do need good computer skills and some knowledge of downloading from the internet as well as installing software.

The course is intended to be very simple so it is not an in depth study of the language. I will produce other courses that explain the language in more detail.

fa4e0874

Meet Your Teacher

Teacher Profile Image

John Singh

Senior Systems Analyst

Teacher

Hi !!. I have been designing and developing software for 20 years. I first began Java programming in 1998 and did a prototype java application that integrated to AS400 midrange computers. In 2000 I obtained my sun certification in java programming and also tried the java developer exam but couldn't complete it because of work commitments.

From 2000 to 2006 I was involved in the design and development of numerous java programs. The one program FTP'd data from the AS400 to a windows machine. In another instant I designed an application that produced an XML document for Creditors remittance.

In 2007 I started working with Java application servers like Tomcat and IBM Websphere application server. I wrote Java servlets and Javabeans. I also got involved with the as400 java tool... See full profile

Class Ratings

Expectations Met?
  • Exceeded!
    0%
  • Yes
    0%
  • Somewhat
    0%
  • Not really
    0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. Course Overview: Welcome to the course. Overview off, Right, your first Java program. My name is John Sing and I will be a guide. Through this training course. The course description is as follows. Java is one of the most popular development languages in the world. It is used by millions of developers and is present on tens of millions of devices. This course get students writing and running the first Java program as quickly as possible without getting into unnecessary details. The location is online, it is self paced, and it is suitable for a beginner. You do need a good knowledge off navigating file systems and working with a computer. A basic knowledge off the Internet is needed. The platform that I use his Windows 10 but you can use other versions of Windows and other operating system. The course objectives is as follows. First, you will download and set up the Java software development. Took it. Secondly, you will learn the theory of creating a Java program. Thirdly, you will create your first job a program and run it last year. You will understand compiler areas. The structural method sized follows lectures in the form of a slideshow with voice. There will be a demo off downloading and installing Java. There will be a demo of typing in your first Java program and then compiling and running it . Thank you very much for your attention. And I hope to see you soon on my training course. Goodbye. 2. Lesson 1 Downloading and installing the JDK: welcome everyone to this session on how to download the Java development. Took it. I'm going to start off, but going to the Orica website. So on this website you can see it days a downloads tab. So click on that scroll down until you see the download button. Click on that. And there are a number of options on this page. The first thing to do is to accept the license agreement. Once you have accepted it, then choose from one of thes child development. Took its there is one for line. X meco is Solaris windows. So I've got Windows 10 and 64. But so I'm gonna click on that and the red download button, and it should start off on the bottom left there has I'm going to cancel this because I've already downloaded it. Okay, so once it's completed downloading, then he should be able to click on it. And you should be able to open the XY from here. Once the XY opens, it launches a wizard, and that wizard will have a number off screens, so it just accept all defaults on the screen. So, basically, just click next, next, next, and the installation will be done for you very easily to verify that the installation is done correctly. Then what you need to do is go to the come on lines. I do that by typing in CMD and you can see that the run command and I'm going to drag us down into the screen here. So on the command line, you type Java and version minus version. You enter and you could see the version is 1.80121 which corresponds do eight and 121 over here. So you know that you have installed and correctly configured the jar development took it. So this is the end of the lesson. I hope you guys enjoyed it and I'll see you in the next one. Goodbye. 3. Lesson 2 Java Program Creation Theory: welcome to listen to Java program creation theory. Learning objectives as follows. The high level steps required to create a Java program. The structure of a Java source file the minimal source required to produce a Java program that can be compiled and run. Java program creation consists of a number of steps. The first is type of source code and save as a dot job. A file. Next compiled a job file by running Java Sea. You will get a dark class file. The co pilot generated dark class file is made up of by coats. Run the program by starting the Java Virtual Machine, or JV M. The JBM translates the by code into platform specific code. This is how Javert she's platform independence or programs are made up with platform independent by Coz, which has to be translated into machine specific code by the Java Virtual machine. A source file must consist of at least one class. Class is structured as shown on the right. It must have opening and closing Curly braces. Inside a class are one or many methods. The methods must occur within the opening and closing curly braces off the class in this case void Draw is the method name inside admitted Ah, one or many statements. Statements must occur within the opening and closing records off the method. It looked more closely at structure off a class. Every job application has to have at least one class at least One main method public means everyone can access this class. First up is the name of the class. Every class must have an opening curly bracket. Let's look at methods. The return type of the method is void. The method name is main. Arguments are passed into the method, which is an array of strength. The method must have an opening curly bracket. The statement is system out the print, which means that a string is printed to standard output. The string is my first program. Every statement must end in a semi colon. Every method must have a closing curly bracket. Every class must have a closing curly bracket. In summary, you have learned the different steps that are required to produce a running Java program. You have learned how Java source is structured into classes, methods and statements. You have learned the minimums basic syntax required to compile and run a Java program. This is the end of the listen. I hope you enjoyed it. Now we'll see you for the next one. 4. Lesson 3 Creating, compiling and running your program: Welcome to listen. Three. Creating, compiling and running your first Java program. Learning objectives as follows. Learn how to type in the source code for a Java program. Secondly, learn how to compile the source code. Thirdly, learn how to call the Java virtual machine and run the program. Lastly, learned how to fix simple compiler areas. Now I'm going to open up the note pad text editor and type in the source. You can use any text editor that you want, so type in no pad into loads up now Sources as follows. Public class first Absar Every source file must have a class. The class name in this case is first up. No, the lower case f upper case A Java is case sensitive so important to obey the rules. Open curly braces for the class. I'm gonna type in the method public static Boyd means avoid means that nothing is returned from this method. Maine is the name of the class, and we're going to type in the arguments, which is rail strings. Name is arms and opening curly braces for the method. Gonna type in the statement system. Not that print federal right. A string to the consul and the string within the right is my first program and has to end with a semicolon. Every statement has to end with a semi colon. The closing curly braces for the method, closing curly braces for the class. So that's the full source for this particular program. And this is a complete running program. Very simple, but nevertheless complete. So I'm going to say this not where you save your source to, because you need to compile it later. This is my particular directory and putting a tube. But it will be different for you typing the program name. Note the no case if an upper case a don't job. And we're gonna change txt to all files because we don't want txt appended to the end off the file name. I'm going to save that now. I'm going to call the command line so they can do compiling into cmd and longer and navigate to women. Source is you won and source me for duty. A artis first after Java clear that now to compile its used Java sea and the name of the class Note Lower case F up case A and dot job compiler runs and compile properly. Now I'm going to call the program using the Java virtual machine that typed in Java First app you don't need that job was now you calling a class file the class while has the bike called which the JBM interprets So the run it you can see is printed out. My my first program, which is what the source says, that it will print out the concert. So that's the compiling and running off the program. Let's look at compile a errors if I remove the semicolon here. Remember, every statement must end of the semi colons on Remove it and copilot and see how compiler reacts. It immediately complains about the semicolon missing. So as you can see the compiler dust, check this and this is how it reports errors. So the other thing compiler chicks is case sensitivity. So if I change string to Lok a string watch what the compiler does now going to compile this plus app and complains about the string you can't find it can't recognizes. So it has to be up a case if we remove closing curly braces. Let's see what compiler does. I'm going to save that and compile it complains about closing curly bracket, being missing in the file while passing so you can see that Java is casing stuff. It does need semicolons after after statements, does need closing curly braces. So you have to be careful and writing programs to make sure that all these are in place. So that's the end off. Listen, and I hope you guys enjoyed it. And I hope you excited about France in your first job program, and I will see you at the next training session.