SlideShare a Scribd company logo
Welcome to Ducat India
Language | IndustrialTraining | Digital Marketing |WebTechnology |
Testing+ | Database | Networking | Mobile Application | ERP | Graphic | Big
Data | Cloud Computing
Apply Now
Call us:
70-70-90-50-90
Basic Syntax
About Java programs, it is paramount to remember the accompanying points.
Class Names –
For all class names, the first letter ought to be in Upper Case. On the off chance that few words are
utilized to structure the name of the class, every internal word’s first letter ought to be in UpperCase.
For example, a common class name is as follows:
class Sample class
Case Sensitivity –
Java is case sensitive, which implies that the identifier Hi and hi would have distinctive
importance in JAVA
Method Names –
All system names ought, to begin with, a Lower Case letter. If a few words are utilized to structure the
name of the method, then every internal word’s first letter ought to be in Upper Case. An example of
this convention is following:
public void mysamplemethod ()
Filename –
The name of the system record ought to precisely match the class name. At the point when you are
saving the file, you ought to keep it utilizing the class name. Remember Java is case touchy and affix
“.java” to the end of the name. If the document name and the class name don’t match your system
won’t assemble.
Consider the example of a class name Sample. In this case, you must name the file as
sample.java.
public static void main(string args[])
Java system handling begins from the main() function, which is a required piece of each
JAVA program.
Java Keywords
Keywords or we can say reserved words in Java. As a rule, these words
cannot be used as names for variables or constants.
List of Java keywords
• abstract
• break
• boolean
• case
• byte
• char
• catch
• const
• class
• default
• continue
• double
• do
• enum
• else
• final
• extends
• float
• finally
• goto
• for
• implements
• if
• instance of
• import
• int
• long
• interface
• new
• native
• private
• package
• protected
• return
• public
• static
• short
• super
• strictfp
• synchronized
• switch
• throw
• this
• transient
• throws
• while
• try
• volatile
• void
Comments in Java
Just as in the case of C++ and C, Java supports two types of comments, namely, single-line
comments and multi-line comments.The syntax for these types of comments are as follows:
Single line comment:
//
Multiple line comment:
/**/
The Java compiler simply ignores all characters that exist in the comments region.
Using Blank Lines:
Any line that is only composed of whitespace characters or comments is considered a blank
line.These lines are just ignored by the compiler and are not included in the executable.
Inheritance:
Java supports inheritance. In other words, it is possible to derive one class from another class in
this programming language. For instance, if you need to create a new class, which is an extension
of an existing class, then you can derive this new class from an existing class. This allows the new
class to access the elements already implemented in the existing class. In this case, the new class is
called the derived class, and the current class is referred to as the superclass.
Interfaces:
As mentioned previously, Java is all about the interaction between objects. How different objects
communicate with each other is defined in what is called an ‘interface.’ Moreover, interfaces are
also an essential aspect of the inheritance feature of java. As part of an interface, the methods that
can be used by a derived or sub-class are declared. However, all the methods declared as usable for
the subclass must be implemented in the subclass.
ThankYou
Call us on: 70-70-90-50-90 || www.ducatindia.com

More Related Content

PDF
Java basic-syntax
PDF
Java basic syntax
PDF
Java basic-syntax
PDF
Common Programming Errors by Beginners in Java
DOCX
Mca 4030 programming in java
DOCX
Mca 4030 programming in java
PDF
JAVA PROGRAMMING – Packages - Stream based I/O
Java basic-syntax
Java basic syntax
Java basic-syntax
Common Programming Errors by Beginners in Java
Mca 4030 programming in java
Mca 4030 programming in java
JAVA PROGRAMMING – Packages - Stream based I/O

What's hot (15)

PPTX
Packages and Interfaces
PPT
Introduction
DOCX
Mit103 object oriented programming
PPTX
Polymorphism
PPSX
Java Object Oriented Programming
PPTX
Packages
DOCX
Class notes(week 7) on packages
DOCX
Mi0041 java and web design
PPTX
Basic online java course - Brainsmartlabs
DOCX
Mi0041 java and web design
PPT
GTU Guidelines for Project on JAVA
PDF
Java packages
PDF
What are Generics in Java | Java Generics Tutorial | Edureka
PDF
Basic Java Programming
PPTX
Coding conventions
Packages and Interfaces
Introduction
Mit103 object oriented programming
Polymorphism
Java Object Oriented Programming
Packages
Class notes(week 7) on packages
Mi0041 java and web design
Basic online java course - Brainsmartlabs
Mi0041 java and web design
GTU Guidelines for Project on JAVA
Java packages
What are Generics in Java | Java Generics Tutorial | Edureka
Basic Java Programming
Coding conventions
Ad

Similar to Basic syntax (20)

PPTX
Suga java training_with_footer
PPTX
Java syntax-and-grammars-oct8
DOCX
Viva file
PPTX
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
PPTX
Java basics
PPTX
Basics of Java
PDF
PPTX
Basics of java 2
PPTX
Android Training (Java Review)
PDF
Java Interview Questions for 10+ Year Experienced PDF By ScholarHat
PPTX
OCA Java SE 8 Exam Chapter 1 Java Building Blocks
PPT
Classes and Objects
PPTX
Java_Roadmap.pptx
PPTX
Core Java
PDF
Java 06
DOCX
Java mcq
PPTX
INDUMATHY- UNIT 1 cs3391 oops introduction to oop and java.pptx
PDF
Object Oriented Principles
PPTX
Abstraction encapsulation inheritance polymorphism
PDF
Bt0074 oops with java2
Suga java training_with_footer
Java syntax-and-grammars-oct8
Viva file
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
Java basics
Basics of Java
Basics of java 2
Android Training (Java Review)
Java Interview Questions for 10+ Year Experienced PDF By ScholarHat
OCA Java SE 8 Exam Chapter 1 Java Building Blocks
Classes and Objects
Java_Roadmap.pptx
Core Java
Java 06
Java mcq
INDUMATHY- UNIT 1 cs3391 oops introduction to oop and java.pptx
Object Oriented Principles
Abstraction encapsulation inheritance polymorphism
Bt0074 oops with java2
Ad

More from Ducat India (20)

PPTX
Join MCSA Server 2016 And 2019 Course In Noida
PPTX
Apply now for dot net training classes in Noida
PPTX
Apply now for linux training classes in noida
PPTX
Apply Now for DevOps Training Classes in Noida
PPTX
Apply Now for AutoCAD Training Course in Noida
PPTX
Amazon Elastic Load Balancing
PPTX
AWS Relation Database Services
PPTX
Microsoft Dynamics CRM – Web Resources
PPTX
Field Types
PPTX
Sprint in jira
PPTX
JIRA Versions
PPTX
Kanban Board in Jira
PPTX
Test Report Preparation
PPTX
What is Text Analysis?
PPTX
Data Science Using Scikit-Learn
PPTX
Struts 2 – Database Access
PPTX
Struts 2 – Interceptors
PPTX
Struts 2 – Architecture
PPTX
Hibernate 5 – merge() Example
PPTX
Hibernate Object States – Transient,Persistent and Detached
Join MCSA Server 2016 And 2019 Course In Noida
Apply now for dot net training classes in Noida
Apply now for linux training classes in noida
Apply Now for DevOps Training Classes in Noida
Apply Now for AutoCAD Training Course in Noida
Amazon Elastic Load Balancing
AWS Relation Database Services
Microsoft Dynamics CRM – Web Resources
Field Types
Sprint in jira
JIRA Versions
Kanban Board in Jira
Test Report Preparation
What is Text Analysis?
Data Science Using Scikit-Learn
Struts 2 – Database Access
Struts 2 – Interceptors
Struts 2 – Architecture
Hibernate 5 – merge() Example
Hibernate Object States – Transient,Persistent and Detached

Recently uploaded (20)

PPTX
Lesson notes of climatology university.
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Pharma ospi slides which help in ospi learning
PDF
Pre independence Education in Inndia.pdf
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
master seminar digital applications in india
PDF
Classroom Observation Tools for Teachers
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Insiders guide to clinical Medicine.pdf
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Complications of Minimal Access Surgery at WLH
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Anesthesia in Laparoscopic Surgery in India
Lesson notes of climatology university.
VCE English Exam - Section C Student Revision Booklet
Microbial disease of the cardiovascular and lymphatic systems
Pharma ospi slides which help in ospi learning
Pre independence Education in Inndia.pdf
GDM (1) (1).pptx small presentation for students
Final Presentation General Medicine 03-08-2024.pptx
master seminar digital applications in india
Classroom Observation Tools for Teachers
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Insiders guide to clinical Medicine.pdf
PPH.pptx obstetrics and gynecology in nursing
Sports Quiz easy sports quiz sports quiz
Renaissance Architecture: A Journey from Faith to Humanism
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Complications of Minimal Access Surgery at WLH
O7-L3 Supply Chain Operations - ICLT Program
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Anesthesia in Laparoscopic Surgery in India

Basic syntax

  • 1. Welcome to Ducat India Language | IndustrialTraining | Digital Marketing |WebTechnology | Testing+ | Database | Networking | Mobile Application | ERP | Graphic | Big Data | Cloud Computing Apply Now Call us: 70-70-90-50-90
  • 2. Basic Syntax About Java programs, it is paramount to remember the accompanying points. Class Names – For all class names, the first letter ought to be in Upper Case. On the off chance that few words are utilized to structure the name of the class, every internal word’s first letter ought to be in UpperCase. For example, a common class name is as follows: class Sample class Case Sensitivity – Java is case sensitive, which implies that the identifier Hi and hi would have distinctive importance in JAVA
  • 3. Method Names – All system names ought, to begin with, a Lower Case letter. If a few words are utilized to structure the name of the method, then every internal word’s first letter ought to be in Upper Case. An example of this convention is following: public void mysamplemethod () Filename – The name of the system record ought to precisely match the class name. At the point when you are saving the file, you ought to keep it utilizing the class name. Remember Java is case touchy and affix “.java” to the end of the name. If the document name and the class name don’t match your system won’t assemble. Consider the example of a class name Sample. In this case, you must name the file as sample.java. public static void main(string args[]) Java system handling begins from the main() function, which is a required piece of each JAVA program. Java Keywords Keywords or we can say reserved words in Java. As a rule, these words cannot be used as names for variables or constants.
  • 4. List of Java keywords • abstract • break • boolean • case • byte • char • catch • const • class • default • continue • double • do • enum • else • final • extends • float • finally • goto • for • implements • if • instance of • import • int • long • interface • new • native • private • package • protected • return • public • static • short • super • strictfp • synchronized • switch • throw • this • transient • throws • while • try • volatile • void
  • 5. Comments in Java Just as in the case of C++ and C, Java supports two types of comments, namely, single-line comments and multi-line comments.The syntax for these types of comments are as follows: Single line comment: // Multiple line comment: /**/ The Java compiler simply ignores all characters that exist in the comments region. Using Blank Lines: Any line that is only composed of whitespace characters or comments is considered a blank line.These lines are just ignored by the compiler and are not included in the executable.
  • 6. Inheritance: Java supports inheritance. In other words, it is possible to derive one class from another class in this programming language. For instance, if you need to create a new class, which is an extension of an existing class, then you can derive this new class from an existing class. This allows the new class to access the elements already implemented in the existing class. In this case, the new class is called the derived class, and the current class is referred to as the superclass. Interfaces: As mentioned previously, Java is all about the interaction between objects. How different objects communicate with each other is defined in what is called an ‘interface.’ Moreover, interfaces are also an essential aspect of the inheritance feature of java. As part of an interface, the methods that can be used by a derived or sub-class are declared. However, all the methods declared as usable for the subclass must be implemented in the subclass.
  • 7. ThankYou Call us on: 70-70-90-50-90 || www.ducatindia.com