SlideShare a Scribd company logo
1 of 13
OOP - JAVA
Understanding of Java basic concepts
10/23/2021 1
Department of Computer
PRO – GRADE 5
Lecturer. OMEED M. M
Lecture 3
Contents
❖ What is NetBeans IDE, and how does it is work?
❖ Understanding of Java program structure
❖ Running first program in java
❖ Some Examples in java
10/23/2021 2
NetBeans IDE
NetBeans IDE is a free and open source integrated development environment for
application development on Windows, Mac, Linux, and Solaris operating systems.
The IDE simplifies the development of web, enterprise, desktop, and mobile
applications that use the Java and HTML5 platforms.
10/23/2021 3
NetBeans IDE
10/23/2021 4
Running first program in java
/* This is a simple Java program.
FileName : "HelloWorld.java". */
public class HelloWorld {
//Your program begins by calling the main().
//Prints "Hello, World" to the terminal window.
public static void main(String args[]) {
System.out.println("Hello World");
}
}
10/23/2021 5
Contents
Output:
Hello World
10/23/2021 6
Three primary components of every program in java
1. Class definition: We use the ‘class’ keyword to declare a new class.
We can also use the access specifier like public before the class
keyword:
public class HelloWorld
2. Hello World is the name of the class that is an identifier in Java. The
class definition contains the members of the class that are enclosed
within the curly braces{}.
3. Java Main() method: Every application in Java programming
language must contain a main() method whose signature is:
public static void main(String[] args)
10/23/2021 7
public static void main(String[] args)
public: We declare the main method as public so that JVM can execute it from
anywhere.
static: We declare the main method as static so that JVM can call it directly
without creating the object of the class.
Note: We can write the modifiers public and static in any order.
void: The main method does not return anything, therefore we declare it as void.
main(): main() is the name that is already configured in the JVM.
String[]: The main() method accepts a single argument which is an array of
elements of type String
10/23/2021 8
Example 1
public class JavaApplication3 {
public static void main(String[] args) {
String FirstName = "Your First name";
String SecondName = "Your Second name";
int age = 22;
int YOB = 1998;
System.out.println(FirstName+"n"+SecondName+"n"+age+"n"+
YOB);
}
}
10/23/2021 9
Write a java program to show your personal detail on the screen (first
name, last name, age, and year of birth)
Example 2
Write a java program to show student grade and department (full
name, name of institute, grade, Gender and specialty)
OUTPUT
10/23/2021 10
Your Full name
Da Vinci Institute
PRO 5A
Male or Fe-male
Example 3
Write a java program to show Sum of two numbers
10/23/2021 11
public static void main(String []args){
int num1 = 6;
int num2 = 3;
double num3 = 3.2;
double sum;
sum = num1+num2+num3;
System.out.println(sum);
}
}
Example 4
Write a java program to check Even or Odd number
10/23/2021 12
public class EvenOddnumber{
public static void main(String []args){
int num = 7;
if ( num % 2 == 0 )
System.out.println(" number is even");
else
System.out.println(" number is odd");
}
}
Any Questions ?
10/23/2021 13

More Related Content

What's hot

Future development stack ~ MeteorJS
Future development stack ~ MeteorJSFuture development stack ~ MeteorJS
Future development stack ~ MeteorJSVictor Stan
 
Frameworks in JavaScript
Frameworks in JavaScriptFrameworks in JavaScript
Frameworks in JavaScriptHaim Michael
 
Grzegorz Witek - MongoDB + RoR, Mongoid (PRUG 1.0)
Grzegorz Witek - MongoDB + RoR, Mongoid (PRUG 1.0)Grzegorz Witek - MongoDB + RoR, Mongoid (PRUG 1.0)
Grzegorz Witek - MongoDB + RoR, Mongoid (PRUG 1.0)ecommerce poland expo
 
ASP Dot Net Software Development in India - iFour Technolab
ASP Dot Net Software Development in India - iFour TechnolabASP Dot Net Software Development in India - iFour Technolab
ASP Dot Net Software Development in India - iFour TechnolabiFour Technolab Pvt. Ltd.
 
The Full Stack Web Development
The Full Stack Web DevelopmentThe Full Stack Web Development
The Full Stack Web DevelopmentSam Dias
 
Node.js Jump Start
Node.js Jump StartNode.js Jump Start
Node.js Jump StartHaim Michael
 
Overview of React.JS - Internship Presentation - Week 5
Overview of React.JS - Internship Presentation - Week 5Overview of React.JS - Internship Presentation - Week 5
Overview of React.JS - Internship Presentation - Week 5Devang Garach
 
제 4회 DGMIT R&D 컨퍼런스 : Making a JavaScript based Application in Mac OS X
제 4회 DGMIT R&D 컨퍼런스 : Making a JavaScript based Application in Mac OS X제 4회 DGMIT R&D 컨퍼런스 : Making a JavaScript based Application in Mac OS X
제 4회 DGMIT R&D 컨퍼런스 : Making a JavaScript based Application in Mac OS Xdgmit2009
 
Angular 2 vs React. What to chose in 2017?
Angular 2 vs React. What to chose in 2017?Angular 2 vs React. What to chose in 2017?
Angular 2 vs React. What to chose in 2017?TechMagic
 
Headless CMS for Digital Agencies - Case Study by Andy Thompson
Headless CMS for Digital Agencies - Case Study by Andy ThompsonHeadless CMS for Digital Agencies - Case Study by Andy Thompson
Headless CMS for Digital Agencies - Case Study by Andy ThompsonKentico Software
 
Angular2.0@Shanghai0319
Angular2.0@Shanghai0319Angular2.0@Shanghai0319
Angular2.0@Shanghai0319Bibby Chung
 
CakeFest 2010 Flex/Flash Builder with CakePHP
CakeFest 2010 Flex/Flash Builder with CakePHPCakeFest 2010 Flex/Flash Builder with CakePHP
CakeFest 2010 Flex/Flash Builder with CakePHPBrandon Plasters
 
Spring Framework - Study Group
Spring Framework - Study GroupSpring Framework - Study Group
Spring Framework - Study GroupAdiyat Mubarak
 
Javascript cheatsheet
Javascript cheatsheetJavascript cheatsheet
Javascript cheatsheetAndrea Tino
 
Empowerment Technologies Lecture 11 (Philippines SHS)
Empowerment Technologies Lecture 11 (Philippines SHS)Empowerment Technologies Lecture 11 (Philippines SHS)
Empowerment Technologies Lecture 11 (Philippines SHS)John Bosco Javellana, MAEd.
 
Improve your Web Development using Visual Studio 2010
Improve your Web Development using Visual Studio 2010Improve your Web Development using Visual Studio 2010
Improve your Web Development using Visual Studio 2010Suthep Sangvirotjanaphat
 
Mean Stack - An Overview
Mean Stack - An OverviewMean Stack - An Overview
Mean Stack - An OverviewNaveen Pete
 
JS digest. January 2018
JS digest. January 2018 JS digest. January 2018
JS digest. January 2018 ElifTech
 

What's hot (20)

Future development stack ~ MeteorJS
Future development stack ~ MeteorJSFuture development stack ~ MeteorJS
Future development stack ~ MeteorJS
 
Frameworks in JavaScript
Frameworks in JavaScriptFrameworks in JavaScript
Frameworks in JavaScript
 
Grzegorz Witek - MongoDB + RoR, Mongoid (PRUG 1.0)
Grzegorz Witek - MongoDB + RoR, Mongoid (PRUG 1.0)Grzegorz Witek - MongoDB + RoR, Mongoid (PRUG 1.0)
Grzegorz Witek - MongoDB + RoR, Mongoid (PRUG 1.0)
 
ASP Dot Net Software Development in India - iFour Technolab
ASP Dot Net Software Development in India - iFour TechnolabASP Dot Net Software Development in India - iFour Technolab
ASP Dot Net Software Development in India - iFour Technolab
 
Asp.net
Asp.netAsp.net
Asp.net
 
The Full Stack Web Development
The Full Stack Web DevelopmentThe Full Stack Web Development
The Full Stack Web Development
 
Node.js Jump Start
Node.js Jump StartNode.js Jump Start
Node.js Jump Start
 
Overview of React.JS - Internship Presentation - Week 5
Overview of React.JS - Internship Presentation - Week 5Overview of React.JS - Internship Presentation - Week 5
Overview of React.JS - Internship Presentation - Week 5
 
Gwt Presentation 1
Gwt Presentation 1Gwt Presentation 1
Gwt Presentation 1
 
제 4회 DGMIT R&D 컨퍼런스 : Making a JavaScript based Application in Mac OS X
제 4회 DGMIT R&D 컨퍼런스 : Making a JavaScript based Application in Mac OS X제 4회 DGMIT R&D 컨퍼런스 : Making a JavaScript based Application in Mac OS X
제 4회 DGMIT R&D 컨퍼런스 : Making a JavaScript based Application in Mac OS X
 
Angular 2 vs React. What to chose in 2017?
Angular 2 vs React. What to chose in 2017?Angular 2 vs React. What to chose in 2017?
Angular 2 vs React. What to chose in 2017?
 
Headless CMS for Digital Agencies - Case Study by Andy Thompson
Headless CMS for Digital Agencies - Case Study by Andy ThompsonHeadless CMS for Digital Agencies - Case Study by Andy Thompson
Headless CMS for Digital Agencies - Case Study by Andy Thompson
 
Angular2.0@Shanghai0319
Angular2.0@Shanghai0319Angular2.0@Shanghai0319
Angular2.0@Shanghai0319
 
CakeFest 2010 Flex/Flash Builder with CakePHP
CakeFest 2010 Flex/Flash Builder with CakePHPCakeFest 2010 Flex/Flash Builder with CakePHP
CakeFest 2010 Flex/Flash Builder with CakePHP
 
Spring Framework - Study Group
Spring Framework - Study GroupSpring Framework - Study Group
Spring Framework - Study Group
 
Javascript cheatsheet
Javascript cheatsheetJavascript cheatsheet
Javascript cheatsheet
 
Empowerment Technologies Lecture 11 (Philippines SHS)
Empowerment Technologies Lecture 11 (Philippines SHS)Empowerment Technologies Lecture 11 (Philippines SHS)
Empowerment Technologies Lecture 11 (Philippines SHS)
 
Improve your Web Development using Visual Studio 2010
Improve your Web Development using Visual Studio 2010Improve your Web Development using Visual Studio 2010
Improve your Web Development using Visual Studio 2010
 
Mean Stack - An Overview
Mean Stack - An OverviewMean Stack - An Overview
Mean Stack - An Overview
 
JS digest. January 2018
JS digest. January 2018 JS digest. January 2018
JS digest. January 2018
 

Similar to understanding of java basics

Similar to understanding of java basics (20)

Chapter 2.1
Chapter 2.1Chapter 2.1
Chapter 2.1
 
JAVA Object Oriented Programming (OOP)
JAVA Object Oriented Programming (OOP)JAVA Object Oriented Programming (OOP)
JAVA Object Oriented Programming (OOP)
 
Java basic introduction
Java basic introductionJava basic introduction
Java basic introduction
 
All experiment of java
All experiment of javaAll experiment of java
All experiment of java
 
Javalecture 1
Javalecture 1Javalecture 1
Javalecture 1
 
java basic for begginers
java basic for begginersjava basic for begginers
java basic for begginers
 
OOPM Introduction.ppt
OOPM Introduction.pptOOPM Introduction.ppt
OOPM Introduction.ppt
 
Javanotes
JavanotesJavanotes
Javanotes
 
JAVA Crash Course-JAED By Sabihuddin Ahmed Siddiqui
JAVA Crash Course-JAED By Sabihuddin Ahmed SiddiquiJAVA Crash Course-JAED By Sabihuddin Ahmed Siddiqui
JAVA Crash Course-JAED By Sabihuddin Ahmed Siddiqui
 
Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)
 
Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)
 
Java interview question
Java interview questionJava interview question
Java interview question
 
CORE JAVA
CORE JAVACORE JAVA
CORE JAVA
 
Unit of competency
Unit of competencyUnit of competency
Unit of competency
 
1.introduction to java
1.introduction to java1.introduction to java
1.introduction to java
 
Introduction to java technology
Introduction to java technologyIntroduction to java technology
Introduction to java technology
 
Core java introduction
Core java introduction Core java introduction
Core java introduction
 
Java Standard edition(Java ) programming Basics for beginner's
Java Standard edition(Java ) programming Basics  for beginner'sJava Standard edition(Java ) programming Basics  for beginner's
Java Standard edition(Java ) programming Basics for beginner's
 
basic_java.ppt
basic_java.pptbasic_java.ppt
basic_java.ppt
 
Java lab-manual
Java lab-manualJava lab-manual
Java lab-manual
 

More from omeed

OOP using java (Variable in java)
OOP using java (Variable in java)OOP using java (Variable in java)
OOP using java (Variable in java)omeed
 
Introduction to oop using java
Introduction  to oop using java Introduction  to oop using java
Introduction to oop using java omeed
 
Asp.net LinkButton & imageButton controls
Asp.net LinkButton & imageButton controlsAsp.net LinkButton & imageButton controls
Asp.net LinkButton & imageButton controlsomeed
 
Asp.net CheckBoxList control
Asp.net CheckBoxList controlAsp.net CheckBoxList control
Asp.net CheckBoxList controlomeed
 
Asp.net CheckBox control
Asp.net CheckBox controlAsp.net CheckBox control
Asp.net CheckBox controlomeed
 
Asp.net RadiobuttonList control
Asp.net RadiobuttonList controlAsp.net RadiobuttonList control
Asp.net RadiobuttonList controlomeed
 
Asp.net Radiobutton control
Asp.net Radiobutton controlAsp.net Radiobutton control
Asp.net Radiobutton controlomeed
 
Asp.net textbox control
Asp.net textbox controlAsp.net textbox control
Asp.net textbox controlomeed
 
WEB DEVELOPMENT Using Python programming language
WEB DEVELOPMENT Using Python programming language WEB DEVELOPMENT Using Python programming language
WEB DEVELOPMENT Using Python programming language omeed
 
Apple’s AI-Powered Personal Assistant Uses DNN - siri
Apple’s AI-Powered Personal Assistant Uses DNN - siri  Apple’s AI-Powered Personal Assistant Uses DNN - siri
Apple’s AI-Powered Personal Assistant Uses DNN - siri omeed
 
Third and fourth generation programming language
Third and fourth generation programming languageThird and fourth generation programming language
Third and fourth generation programming languageomeed
 
analog clock C#
analog clock C#analog clock C#
analog clock C#omeed
 
graphic Design
graphic Design graphic Design
graphic Design omeed
 

More from omeed (13)

OOP using java (Variable in java)
OOP using java (Variable in java)OOP using java (Variable in java)
OOP using java (Variable in java)
 
Introduction to oop using java
Introduction  to oop using java Introduction  to oop using java
Introduction to oop using java
 
Asp.net LinkButton & imageButton controls
Asp.net LinkButton & imageButton controlsAsp.net LinkButton & imageButton controls
Asp.net LinkButton & imageButton controls
 
Asp.net CheckBoxList control
Asp.net CheckBoxList controlAsp.net CheckBoxList control
Asp.net CheckBoxList control
 
Asp.net CheckBox control
Asp.net CheckBox controlAsp.net CheckBox control
Asp.net CheckBox control
 
Asp.net RadiobuttonList control
Asp.net RadiobuttonList controlAsp.net RadiobuttonList control
Asp.net RadiobuttonList control
 
Asp.net Radiobutton control
Asp.net Radiobutton controlAsp.net Radiobutton control
Asp.net Radiobutton control
 
Asp.net textbox control
Asp.net textbox controlAsp.net textbox control
Asp.net textbox control
 
WEB DEVELOPMENT Using Python programming language
WEB DEVELOPMENT Using Python programming language WEB DEVELOPMENT Using Python programming language
WEB DEVELOPMENT Using Python programming language
 
Apple’s AI-Powered Personal Assistant Uses DNN - siri
Apple’s AI-Powered Personal Assistant Uses DNN - siri  Apple’s AI-Powered Personal Assistant Uses DNN - siri
Apple’s AI-Powered Personal Assistant Uses DNN - siri
 
Third and fourth generation programming language
Third and fourth generation programming languageThird and fourth generation programming language
Third and fourth generation programming language
 
analog clock C#
analog clock C#analog clock C#
analog clock C#
 
graphic Design
graphic Design graphic Design
graphic Design
 

Recently uploaded

Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........LeaCamillePacle
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxsqpmdrvczh
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 

Recently uploaded (20)

Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 

understanding of java basics

  • 1. OOP - JAVA Understanding of Java basic concepts 10/23/2021 1 Department of Computer PRO – GRADE 5 Lecturer. OMEED M. M Lecture 3
  • 2. Contents ❖ What is NetBeans IDE, and how does it is work? ❖ Understanding of Java program structure ❖ Running first program in java ❖ Some Examples in java 10/23/2021 2
  • 3. NetBeans IDE NetBeans IDE is a free and open source integrated development environment for application development on Windows, Mac, Linux, and Solaris operating systems. The IDE simplifies the development of web, enterprise, desktop, and mobile applications that use the Java and HTML5 platforms. 10/23/2021 3
  • 5. Running first program in java /* This is a simple Java program. FileName : "HelloWorld.java". */ public class HelloWorld { //Your program begins by calling the main(). //Prints "Hello, World" to the terminal window. public static void main(String args[]) { System.out.println("Hello World"); } } 10/23/2021 5
  • 7. Three primary components of every program in java 1. Class definition: We use the ‘class’ keyword to declare a new class. We can also use the access specifier like public before the class keyword: public class HelloWorld 2. Hello World is the name of the class that is an identifier in Java. The class definition contains the members of the class that are enclosed within the curly braces{}. 3. Java Main() method: Every application in Java programming language must contain a main() method whose signature is: public static void main(String[] args) 10/23/2021 7
  • 8. public static void main(String[] args) public: We declare the main method as public so that JVM can execute it from anywhere. static: We declare the main method as static so that JVM can call it directly without creating the object of the class. Note: We can write the modifiers public and static in any order. void: The main method does not return anything, therefore we declare it as void. main(): main() is the name that is already configured in the JVM. String[]: The main() method accepts a single argument which is an array of elements of type String 10/23/2021 8
  • 9. Example 1 public class JavaApplication3 { public static void main(String[] args) { String FirstName = "Your First name"; String SecondName = "Your Second name"; int age = 22; int YOB = 1998; System.out.println(FirstName+"n"+SecondName+"n"+age+"n"+ YOB); } } 10/23/2021 9 Write a java program to show your personal detail on the screen (first name, last name, age, and year of birth)
  • 10. Example 2 Write a java program to show student grade and department (full name, name of institute, grade, Gender and specialty) OUTPUT 10/23/2021 10 Your Full name Da Vinci Institute PRO 5A Male or Fe-male
  • 11. Example 3 Write a java program to show Sum of two numbers 10/23/2021 11 public static void main(String []args){ int num1 = 6; int num2 = 3; double num3 = 3.2; double sum; sum = num1+num2+num3; System.out.println(sum); } }
  • 12. Example 4 Write a java program to check Even or Odd number 10/23/2021 12 public class EvenOddnumber{ public static void main(String []args){ int num = 7; if ( num % 2 == 0 ) System.out.println(" number is even"); else System.out.println(" number is odd"); } }