OOPJ Workbook
OOPJ Workbook
’s
Deogiri Institute of Engineering and Management
Studies, Aurangabad
Department of Computer Science
and Engineering
Work-Book
On
Object Oriented Programming in
Java
Introduction to Programming Languages
1. What is Programming Language (PL)?
2. Classification of PL
3. Why to learn Java in 2021
4. Introduction to Java
5. Recommended Resources
2. Classification of PL
Java is based on C and C++. The first Java compiler was developed by
Sun Microsystems and was written in C using some libraries from C++.
Java files are converted to bit code format using a compiler that the Java
interpreter then executes. Java is different from c and c++ with respect to
following scenarios
Before we start learning Java, let’s get familiar with common java terms.
Exercise :
1. What is the purpose of the method public static void
main in a Java program?
2. What is the purpose of System.out.println()?
3. Write a program to display hello world
Solution:
Keywords in java:
Control Statements:
Every programming language has control structures which
are used to control the execution flow of the code.
Exercise:
1. Write a program in Java to display n terms of natural
numbers and their sum.
Test Data
Input the number: 2
Expected Output:
Input number: 2
The first n natural numbers are:
2
1
2
The Sum of Natural Number up to n terms: 23
2. Solve the challenge given in following link
https://www.hackerrank.com/challenges/java-if-
else/problem
3. Write a java program to find sum of all digits of a given
number.
Java Tutorial 1
Java Tutorial 2
Edureka Video Tutorial
Telusko Video Tutorial
Java Hindi Tutorial