Java Programming Commands
Class XI – Computer Science Project File
Introduction
Java is a high-level, object-oriented programming language developed by Sun Microsystems. It
is widely used for developing desktop applications, web applications, and mobile apps. This
project explains basic Java programming commands commonly taught in Class 11.
Basic Structure of a Java Program
Every Java program has a class definition and a main method. The main method is the entry
point of the program.
Important Java Keywords
• class – Used to declare a class
• public – Makes a class or method accessible everywhere
• static – Allows method to be called without creating an object
• void – Specifies no return value
• main – Starting point of program execution
• int, float, double – Used to declare numeric variables
• char – Used to store a single character
• String – Used to store text
Input and Output Commands
[Link]() is used to print output on the screen. Scanner class is used to take input
from the user.
Java Operators
• Arithmetic Operators: +, -, *, /, %
• Relational Operators: ==, !=, >, <, >=, <=
• Logical Operators: &&, ||, !
• Assignment Operator: =
Control Statements
Control statements are used to control the flow of execution of a program.
• if statement – Executes code when condition is true
• if-else statement – Executes alternative code when condition is false
• switch statement – Selects execution paths based on value
• for loop – Repeats code for a fixed number of times
• while loop – Repeats code while condition is true
• do-while loop – Executes code at least once
Arrays in Java
An array is a collection of similar type elements stored at contiguous memory locations.
Conclusion
Java programming commands form the foundation of learning computer programming.
Understanding these basic commands helps students write simple and effective Java programs.