Let us get started the hard way: compiling and launching a Java program from thecommand line.
You should see the output in the shell window.
Compiling and running Welcome.java
Congratulations! You have just compiled and run your first Java program.
What happened? The javac program is the Java compiler. It compiles the file Welcome .javainto the file Welcome .class. The java program launches the Java virtual machine. It executes the bytecodes that the compiler placed in the class file.
NOTE: If you got an error message complaining about the line for (String g : greeting)then you probably use an older version of the Java compiler. Java SE 5.0 introduced a numberof very desirable features to the Java programming language, and we take advantage of them here.
If you are using an older version of Java, you need to rewrite the loop as follows:
for (int i = 0; i < greeting.length; i++)
The Welcome program is extremely simple. It merely prints a message to the console. You may enjoy looking inside the program shown in Listing below
In the age of visual development environments, many programmers are unfamiliar with running programs in a shell window. Any number of things can go wrong, leading to frustrating results.
Pay attention to the following points:
Core Java Related Interview Questions
|J2EE Interview Questions||Core Java Interview Questions|
|JDBC Interview Questions||JSP Interview Questions|
|Android Interview Questions||JavaServer Faces (JSF) Interview Questions|
|Java collections framework Interview Questions||Java 8 Interview Questions|
|Java Collections Interview Questions||Java Exception Handling Interview Questions|
|Java Concurrency Interview Questions||Java Serialization Interview Questions|
|Java Programmer Interview Questions||Java Inheritance Interview Questions|
|Java IO Interview Questions||Object Oriented Programming in PHP Interview Questions|
Core Java Tutorial
An Introduction To Java
The Java Programming Environment
Fundamental Programming Structures In Java
Objects And Classes
Interfaces And Inner Classes
User Interface Components With Swing
Deploying Applications And Applets
Exceptions, Logging, Assertions, And Debugging
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.