0% found this document useful (0 votes)
1 views4 pages

Java_Basic_Programming_Guide

The document is a basic guide to Java programming, covering its definition, program structure, data types, variables, operators, control statements, methods, object-oriented concepts, and arrays. It also lists popular Integrated Development Environments (IDEs) for Java development. The guide includes code examples to illustrate key concepts.

Uploaded by

Podi malli
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views4 pages

Java_Basic_Programming_Guide

The document is a basic guide to Java programming, covering its definition, program structure, data types, variables, operators, control statements, methods, object-oriented concepts, and arrays. It also lists popular Integrated Development Environments (IDEs) for Java development. The guide includes code examples to illustrate key concepts.

Uploaded by

Podi malli
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Java Basic Programming Guide

1. What Is Java?

Java is a high-level, object-oriented, platform-independent programming language. It was created by James

Gosling at Sun Microsystems and is used in various domains like Android apps, desktop software, web apps,

and more.

2. Java Program Structure

public class HelloWorld {

public static void main(String[] args) {

System.out.println("Hello, World!");

3. Java Data Types

int num = 10;

double pi = 3.14;

char letter = 'A';

boolean isTrue = true;

String text = "Java";

4. Variables and Operators

int a = 5, b = 3;

int sum = a + b;

System.out.println("Sum: " + sum);


Java Basic Programming Guide

5. Control Statements

if-else:

int age = 18;

if (age >= 18) {

System.out.println("Adult");

} else {

System.out.println("Minor");

for loop:

for (int i = 1; i <= 5; i++) {

System.out.println("Count: " + i);

while loop:

int i = 1;

while (i <= 5) {

System.out.println(i);

i++;

6. Methods (Functions)

public static int add(int x, int y) {

return x + y;
Java Basic Programming Guide

7. Object-Oriented Basics

public class Car {

String model = "Toyota";

void drive() {

System.out.println("Driving " + model);

public class Main {

public static void main(String[] args) {

Car myCar = new Car();

myCar.drive();

8. Array Example

int[] numbers = {1, 2, 3, 4};

for (int n : numbers) {

System.out.println(n);

9. Java IDEs
Java Basic Programming Guide

Popular IDEs for Java programming include:

- IntelliJ IDEA

- Eclipse

- NetBeans

- VS Code (with Java extension)

You might also like