ITP

BSc IT - Structure Programming Methodology - Java

What is keyword in java ? with example.

In : BSc IT Subject : Structure Programming Methodology - Java

In Java, a keyword is a reserved word that has a special meaning and purpose in the language. These words are part of the syntax and cannot be used as identifiers (like variable names, method names, or class names). Keywords tell the compiler how to interpret the code. For example, `class` is used to define a class, `public` sets access levels, and `static` allows methods to run without creating objects.  

##Example:

public class Hello {
    public static void main(String[] args) {
        System.out.println("Hello Java");
    }
}

Here, `public`, `class`, `static`, and `void` are all Java keywords. Each plays a specific role in defining how the program works.

About us

A truly open platform where you may ask questions and get answers. We also provide comprehensive and easy-to-understand answers to question papers.  discover...

Site status

Flag Counter

Privacy Policy

Sitemap