

Understanding the keywords
Presentation
•
Computers
•
12th Grade
•
Hard
Kenneth Galdo
FREE Resource
9 Slides • 0 Questions
1
Understanding the Syntax
Presented by: Kenneth Walter Galdo
Computer Programming III - JAVA OOP
2
Basic Syntax
Case Sensitivity − Java is case sensitive, which means identifier Hello and hello would have different meaning in Java.
Class Names − For all class names the first letter should be in Upper Case. If several words are used to form a name of the class, each inner word's first letter should be in Upper Case.
Example: class MyFirstJavaClass
3
Basic Syntax
Method Names − All method names should start with a Lower Case letter. If several words are used to form the name of the method, then each inner word's first letter should be in Upper Case.
Example: public void myMethodName()
4
Basic Syntax
Program File Name − Name of the program file should exactly match the class name.
When saving the file, you should save it using the class name (Remember Java is case sensitive) and append '.java' to the end of the name (if the file name and the class name do not match, your program will not compile).
Example: Assume 'MyFirstJavaProgram' is the class name. Then the file should be saved as 'MyFirstJavaProgram.java'
5
Reserved Word or Keywords
it has special meaning and cannot be used in naming variables, classes, methods, or identifiers. The Java language designates certain keywords that the compiler recognizes as reserved words.
Understanding the keywords
6
The basic parts of the main method are the heading and the body
The public static void main (String[] args) is called the heading.
the statements enclosed between brackets { body } form the body of the main method. It contains the declaration and execution of the program.
7
Here is an explanation of meaning and purpose of the terms used in the method heading
The keyword public is an access modifier. Method heading should be public for the Java interpreter to call it and run the class.
The keyword static means that a method is accessible and usable.
The keyword void indicates that the main method does not return any value when it is called.
The contents between the parentheses of the main method, which is String[] args, represent the type of argument that can be passed to the main method.
8
Variable
It is a name for a memory location that stores a specific value, such as numbers and letters. It can only hold 1 value at a time.
data_type variable_name [= value];
examples:
int a = 23;
int b = 10, b = 5 + 3;
float f = 2.75f;
double grade - 2.75;
char letter = 'A';
byte b;
int size; size = 30;
9
Constant
it is a memory location whose value cannot be changed during program execution.
Syntax : final data_type variable_name = value;
final double Pi = 3.14159;
final int squareSides = 4;
final char blankSpace = ' ';
final int hour_per_day; hour_per_day = 24;
Understanding the Syntax
Presented by: Kenneth Walter Galdo
Computer Programming III - JAVA OOP
Show answer
Auto Play
Slide 1 / 9
SLIDE
Similar Resources on Wayground
5 questions
Sneezy The Snowman
Presentation
•
KG
6 questions
S3 DDD - Analysis starter (2)
Presentation
•
11th Grade
5 questions
ภาษาจาวา หน่วยที่ 1
Presentation
•
12th Grade
7 questions
Chapter 13
Presentation
•
University
7 questions
Viikonpäivät ja kellonajat
Presentation
•
KG
6 questions
Informatika
Presentation
•
12th Grade
4 questions
Teknik Informatika X SMA
Presentation
•
12th Grade
Popular Resources on Wayground
6 questions
PRIDE Always and Everywhere
Presentation
•
12th Grade
20 questions
Lab Safety Quiz
Quiz
•
6th Grade
26 questions
KOR Review Kahoot Questions
Quiz
•
8th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
12 questions
Unit Zero lesson 2 cafeteria
Presentation
•
9th - 12th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
10 questions
Riddles Riddles fun Riddles
Quiz
•
6th - 12th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade