Skip to header Skip to main navigation Skip to main content Skip to footer

User account menu

  • Log in
Home
COPA
Computer Operator and Programming Assistant

Main navigation

  • Home
    • COPA Assessment Criteria
    • COPA Job Role
    • Course Information
  • Books
  • Question Paper
  • Syllabus

Basic JAVA language elements – keywords, comments, data types and variables

Breadcrumb

  • Home
  • Introduction to Programming in Java
  • Basic JAVA language elements – keywords, comments, data types and variables

Network

ITI Trade Subject

  • ITI Electrician
  • ITI Fitter
  • ITI COPA
  • ITI Welder
  • ITI Mechanic
  • ITI Electronics
  • ITI Wireman
  • ITI Draughtsman Civil & Mech
  • ITI Refrigeration & Air Conditioning
  • ITI Turner
  • ITI Plumber
  • ITI Machinist
  • ITI Cosmetology
  • ITI Sewing
  • ITI Surveyor
By Anand | 12:29 PM IST, Fri March 13, 2026

Basic Java Language Elements – Keywords, Comments, Data Types and Variables

Java is one of the most widely used programming languages in modern software development. It is used to create web applications, desktop software, mobile applications, and enterprise systems. Before learning advanced programming concepts, it is important to understand the basic elements of the Java language.

The basic elements of Java programming include keywords, comments, data types, and variables. These elements form the foundation of Java programming and help programmers write structured and efficient programs.

For students studying the ITI COPA (Computer Operator and Programming Assistant) trade, understanding these basic language elements is essential because they are used in almost every Java program.

Java Keywords

Keywords are reserved words in the Java programming language that have special meanings. These words are used by the Java compiler to perform specific tasks and cannot be used as identifiers such as variable names or class names.

Java provides many keywords that are used to define classes, control program flow, declare variables, and perform various operations.

Examples of Java Keywords

  • class
  • public
  • static
  • void
  • if
  • else
  • for
  • while
  • return
  • int
  • double
  • boolean

Example of using keywords in a Java program:

public class Example {

    public static void main(String[] args) {
        int number = 10;
        System.out.println(number);
    }

}

In this program, words like public, class, static, void, and int are Java keywords.

Java Comments

Comments are used to explain the code and make it easier for other programmers to understand the program. Comments are ignored by the Java compiler and do not affect program execution.

Comments are useful for documenting programs and describing complex logic.

Types of Comments in Java

Java supports three types of comments.

Single-line Comment

Single-line comments begin with two forward slashes (//).

// This is a single-line comment
System.out.println("Hello Java");

Multi-line Comment

Multi-line comments begin with /* and end with */.

/*
This is a multi-line comment
used to explain multiple lines
of code
*/

Documentation Comment

Documentation comments begin with /** and are used to generate documentation using tools such as Javadoc.

/**
 * This method prints a message
 */

Comments improve the readability and maintainability of programs.

Data Types in Java

A data type specifies the type of data that a variable can store. Java is a strongly typed programming language, which means every variable must be declared with a specific data type.

Java data types are divided into two main categories:

  • Primitive Data Types
  • Non-Primitive Data Types

Primitive Data Types

Primitive data types are the basic built-in data types provided by Java.

Data TypeDescriptionExample
intStores integer numbers10
floatStores decimal numbers5.5
doubleStores large decimal numbers25.678
charStores a single character'A'
booleanStores true or false valuestrue
byteStores small integer values8
shortStores smaller integers100
longStores large integers100000L

Non-Primitive Data Types

Non-primitive data types are used to store more complex data.

Examples include:

  • String
  • Arrays
  • Classes
  • Interfaces

Example:

String name = "Rahul";

Here, String is a non-primitive data type.

Variables in Java

A variable is a container used to store data values. Variables allow programmers to store information that can be used or modified during program execution.

Each variable must have a data type and a name.

Syntax:

dataType variableName = value;

Example:

int age = 20;
double price = 99.99;
char grade = 'A';
boolean status = true;

In these examples, age, price, grade, and status are variables.

Rules for Naming Variables

Java has certain rules for naming variables.

  • Variable names must begin with a letter, underscore, or dollar sign.
  • Variable names cannot start with numbers.
  • Variable names cannot contain spaces.
  • Java keywords cannot be used as variable names.

Examples of valid variable names:

  • age
  • studentName
  • totalMarks

Types of Variables in Java

Java supports three types of variables.

Local Variables

Local variables are declared inside a method and can only be used within that method.

Instance Variables

Instance variables are declared inside a class but outside methods. They belong to objects of the class.

Static Variables

Static variables belong to the class rather than objects. They are shared among all objects of the class.

Example Java Program Using Variables

public class Student {

    public static void main(String[] args) {

        String name = "Rahul";
        int age = 20;

        System.out.println("Name: " + name);
        System.out.println("Age: " + age);

    }

}

This program declares variables and prints their values.

Importance for ITI COPA Students

For students studying the ITI COPA trade, understanding basic Java language elements is essential for learning programming.

Keywords define the structure of programs, comments help document code, data types specify the type of information stored, and variables allow programs to store and process data.

These concepts form the foundation of Java programming and are used in almost every software application.

Conclusion

Basic Java language elements such as keywords, comments, data types, and variables are fundamental components of Java programming.

Keywords define program structure, comments improve readability, data types determine the type of data stored, and variables allow programs to store and manipulate data.

For ITI COPA students, mastering these basic concepts provides a strong foundation for learning advanced Java programming topics and developing real-world software applications.

Book traversal links for Basic JAVA language elements – keywords, comments, data types and variables

  • ‹ Introduction to Programming in Java
  • Up
  • Compilation and Execution of JAVA programs ›
  • Printer-friendly version

Article

Types of Files in Computer System
Safety Signs and Symbols Used in Workplace
Safety Rules While Using Computer
Can I start my own business after doing ITI in COPA trade?
Scope in Government Jobs after Doing ITI in COPA

Books

Introduction to Programming in Java
Programming language (Python)
Cloud Computing
Cyber Security
Advanced Excel Concepts
Database Concepts
Communicating in a Connected World
Using Spread Sheet Application
Designing Static Web Pages
Internet Concepts
Configuring and Using Networks
Database Management
Image editing, Creating presentations & Using Open Office
Using Word Processing Software
Familiarization with DOS CLI & Linux Operating Systems.
🖥️ Computer Hardware Basics and Software Installation
🖥️ Computer Components and Windows Operating System
Cyber Security
E Commerce
Smart Accounting
Introduction to VBA, Features and Applications
Introduction to JavaScript 🧠💻
Web Design Concepts
Internet Concepts 🌐
Networking Concepts 🌐
🗄️ Database Management Systems (DBMS)
Power Point Presentations
📊 Spreadsheet Application – Trade Theory for COPA
📝 Word Processing – Trade Theory for COPA
🖥️ Introduction to DOS Command Line Interface & Linux Operating System – Trade Theory for COPA
🖥️ Computer Hardware Basics and Software Installation – Trade Theory for COPA
Introduction to Computers and Windows Operating System

Question Paper

Hindi

COPA 2024 – प्रश्न पत्र सेट 11
COPA 2024 – प्रश्न पत्र सेट 1
COPA 2024 – प्रश्न पत्र सेट 2
COPA 2024 – प्रश्न पत्र सेट 3
COPA 2024 – प्रश्न पत्र सेट 4
COPA 2024 – प्रश्न पत्र सेट 5
COPA 2024 – प्रश्न पत्र सेट 6
COPA 2024 – प्रश्न पत्र सेट 7
COPA 2024 – प्रश्न पत्र सेट 8
COPA 2024 – प्रश्न पत्र सेट 9
COPA 2024 – प्रश्न पत्र सेट 10

English

ITI COPA 2023 Question Paper
ITI COPA 2023 Question Paper – Set 2
ITI COPA 2023 Question Paper – Set 3
ITI COPA 2023 Question Paper – Set 4

Common Subject

  • Engineering Drawing
  • Employability Skills
  • Workshop Calculation Science

Directory

  • Industrial Training Institutes
  • Engineering College
  • Medical College

Knowledge Bank

  • ITI Syllabus
  • Tools

Copyright © 2026 Company Name - All rights reserved

Developed and Designed by Alaa Haddad at Flash Web Center, LLC