Loading video...
Introduction to Java
- Java is an object-oriented, event-driven, stand-alone programming language
- Java programs can be created in a standard text editor
- Programs can be run through a command prompt or an IDE such as NetBeans
- All Java programs must contain the public static void main method
- Comments can be added by using the double-slash (//)
Introduction to Java
Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.
- Intro
- What is Java?
- Writing a Java Program
- Starting Point of All Java Code
- 'Public Static Void Main' Syntax
- How to Add Comments
- Java Statements
- Example1: Text-printing Program
- Example 2: Text-printing on Multiple Lines
- Example 3: Addition Program that Displays the Sum of Two Numbers
- Example 4: Program that Determines Calculations of Two Numbers
- Example 5: Running Programs Through NetBeans IDE

































1 answer
Last reply by: Venugopal Ghanta
Sat Jan 15, 2011 3:07 PM
Post by Venugopal Ghanta on January 14, 2011
are there any programs that let you test this out?
0 answers
Post by Jacob/Benja Share on November 27, 2011
In the Java Script tutorials he said that Java Script and Java have nothing in common but after going through the Java Script this looks very similar.
1 answer
Last reply by: Patti Henderson
Wed Nov 7, 2012 2:08 AM
Post by Jacob/Benja Share on January 15, 2012
When I tried to run the first java program in terminal this is what I saw:
Exception in thread "main" java.lang.NoClassDefFoundError: welcome
Caused by: java.lang.ClassNotFoundException: welcome
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247).
And this is what I typed in the file "welcome.java":
public class welcome
{
public static void main( string args[] )
{
system.out.println( "Welcome" );
}
}
.
Please tell me what I would do. Thx.
0 answers
Post by Kamran Ravan on January 25, 2012
are we going to get the slides?
0 answers
Post by Jialan Wang on March 31, 2012
in 6:05 the program says 500 meters equals 310694.1 miles
what's with that
0 answers
Post by Jorge Guerrero on April 2, 2012
Maury, Java is not open-source, even though for now it's free. You should therefore, instruct students on how to setup a developer IDE environment for running Java Script. It won't run on the command prompt either, if you haven't installed the SDK from Oracle's Java site. Neither will NetBeans IDE intall OR run if you don't have the said SDK. The installer takes quite a bit of space on the hard drive, so you should also mention this to students. Once you instruct on what and how to install, THEN you can go ahead and run the scripts. It's not clear for the novice what you're doing or where you're doing it when you're running the example programs.
0 answers
Post by Jorge Guerrero on April 2, 2012
Maury, you should have a section on how to setup the user interface. I set mine up and it was a PAIN. I also had to find a workaround for java to run the programs from the command prompt. It was not easy. Also, the NetBeans program does not run individual project files by clicking the huge green button. You need to right click the file in the project window and run just THAT file. Otherwise, NetBeans will run the main class file and may confuse the user, because the default file is written without errors, but outputs nothing. You really need to include this section, please, for the students and newbies. Seems like learning Java is worth a while; I'll see if all my frustration pays off after taking the two courses offered by educator.com. I like to take courses here for intro.
0 answers
Post by majak maker on May 14, 2012
my question is not about this video. how do you encipher and decipher a text using a key word?
1 answer
Thu Nov 1, 2012 2:38 PM
Post by george masih on June 12, 2012
import java.io.*;
import java.util.*;
class string {
public static void main(String[] args){
Scanner sc = new Scanner(system.in);
String i = sc.next();
System.out.println(i);
System.out.print("tesing input ");
----------------
i got error when i run this programme i am using eclipse editor it says scanner statement is not correct.is there anyone can help me to correct this programme
thanks
0 answers
Post by Patti Henderson on November 7, 2012
Syntax Errors - } ; ) missing
1 answer
Wed Nov 7, 2012 6:41 PM
Post by Patti Henderson on November 7, 2012
Can we download and save the slides? Thanks
0 answers
Post by Dana Amin on December 4, 2012
I would like to know if Java is used to creat systems out there please? such as bank system and companies system ? if not what is that language which is used ? thanks
0 answers
Post by R Grose on February 11 at 09:46:53 PM
Is there a reference or textbook you recommend to go along with the lecture
0 answers
Post by Jonathan Romo on March 3 at 03:07:21 PM
These lectures are hard to follow. If you could elaborate a little more, slow down, and show how to setup the user interface as Jorge Guerrero said that would be really helpful.
0 answers
Post by Natalia Frenkel on April 29 at 01:49:54 PM
When I tried to test my first java code, I got thei mwssage:
Caused by: java.lang.ClassNotFoundException: chargebac
k.MyFirstApp.java
at java.net.URLClassLoader.findClass(URLClassLoader.java:434)
at java.lang.ClassLoader.loadClass(ClassLoader.java:660)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:358)
at java.lang.ClassLoader.loadClass(ClassLoader.java:626)
Please, help me to undestand why is that. What should I fix ?