Those programs which I have practiced while learning JAVA are uploaded here. Which includes all teh basics of JAVA and some programs like :
Fibonacci Series
Armstrong Number
Prime Number
Conditional Statements programs
Different method calling
initialisation of objects
Arrays : 1-D and 2-D
And many more ...
NOTE: We can also use any IDE's like NETBEANS and others but for remembering the commands of java
at the starting we should work in notepad and command-line only, this will increase our speed of
typing and also decrease our laziness of typing long codes.
Q-1: How to create file with .java extension using command line?
A-1: Using command notepad [file-name].java you can create a notepad file with extension java.
$ notepad first.java
Q-2: How to compile the java code using command line?
After writing some java code first we have to compile that code which will create a file with [file-name].class extension which will help us to run the program.
use command:
e.g. javac [file-name].java
$ javac first.java
Q-3: How to run the java code in command line?
With help of file with .class extension you can run the program created previously by using command java [filename] without any extension will run the java program and if there is any kind of error so it will throw it while compiling that program.
Use command :
e.g. java [file-name]
$ java first