Java Programming lesson 1 java structure.pptx

cluttertans 63 views 11 slides Aug 04, 2024
Slide 1
Slide 1 of 11
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11

About This Presentation

Java Anatomy


Slide Content

JAVA PROGRAMMING

BASIC ANATOMY OF A JAVA PROGRAM

PARTS OF JAVA PROGRAM Class Name – Indicates the name of the class. – The class uses an access specifier public, which indicates that our class in accessible to other classes from other.

PARTS OF JAVA PROGRAM Start of a Block (Class) – Indicates the beginning of a class .

PARTS OF JAVA PROGRAM Method Name – The main method is the starting point of a Java program.

PARTS OF JAVA PROGRAM Start of a Block (Method) – Indicates the beginning of a method.

PARTS OF JAVA PROGRAM Body – It consists of statements and compound statements.

PARTS OF JAVA PROGRAM Close of the Blocks ; Close the class and method respectively.

JAVA Main Method public static void main(String args[])  − Java program processing starts from the main() method which is a mandatory part of every Java program. Let's split it and understand one by one. 1. public- Here public is an access specifier which allows the main method to be accessible everywhere. 2. static- static helps main method to get loaded without getting called by any instance/object. 3. void- void clarifies that the main method will not return any value. 4. main- It's the name of the method. 5. String[] args- Here we are defining a String array to pass arguments at command line. args is the variable name of the String array. It can be changed to anything such as String [] a.

SEMICOLON (;) It shows the compiler where an instruction ends and where the next instruction begins

Saving your project in Java A Java class file is a file (with the .java class filename extension) containing Java bytecode that can be executed on the Java Virtual Machine (JVM). A Java class file is usually produced by a Java compiler from Java programming language source files
Tags