MCS-024 2 - MCS 24 PDF

Title MCS-024 2 - MCS 24
Author umesh yadav
Course Object Oriented Technologies and Java Programming
Institution Indira Gandhi National Open University
Pages 38
File Size 3.4 MB
File Type PDF
Total Downloads 103
Total Views 184

Summary

MCS 24...


Description

MCS-024 SOLVED ASSIGNMENT 2019-20

MCS-024 Object Oriented Technologies and Java Programming Solved Assignment 2019-2020 Q1. (a) Explain basic concepts of Object Oriented Programming? Explain how data hiding is achieved. Answer:- Object-Oriented Programming is a methodology or paradigm to design a program using classes and objects. It simplifies the software development and maintenance by providing some concepts:  

 



Object - Any entity that has state and behaviour is known as an object. An Object can be defined as an instance of a class. Class - Collection of objects is called class. It is a logical entity. A class can also be defined as a blueprint from which you can create a individual object. Class doesn't consume any space. Inheritance - When one object acquires all the aviours of a parent object, it is known as inherit Polymorphism - If one task is p wn as polymorphism. In Java overriding to achi Abstracti unctionality is known as and interface to achieve wrapping) code and data together into a as encapsulation. A java class is the example of Java bean is the fully encapsulated class because all the embers are private here.

Data Hiding - Data hiding is a software development technique specifically used in object-oriented programming (OOP) to hide internal object details (data members). Data hiding ensures exclusive data access to class members and protects object integrity by preventing unintended or intended changes. Data hiding also reduces system complexity for increased robustness by limiting interdependencies between software components. Q1.(b) Explain use of different types of operators available in java with the help of examples. Answer:- There are seven types of operators in java which are discussed below:-

pg. 1

IGNOU Help

MCS-024 SOLVED ASSIGNMENT 2019-20

1. Arithmetic Operators - Arithmetic operators are used to perform mathematical operations like addition, subtraction, multiplication etc. Operator

Description

+

Addition (also used for string concatenation)

-

Subtraction

*

Multiplication

/

Division

%

Remainder

public class Arithmetic_Operators { public static void main(String args[]) { int a=25, b=10; System.out.println("Result of (a + System.out.println("Resul System.out.println( System.out Sys

(a % b));

O Result of (a + b) is = 35 Result of (a - b) is = 15 Result of (a * b) is = 250 Result of (a / b) is = 2 Result of (a % b) is = 5

2. Relational Operators - Relational operators in Java programming are mostly used either in If Conditions or Loops. Java Relational operators are commonly used to check the relationship between two variables.  

pg. 2

If the relation is true then it will return Boolean True If the relation is false then it will return Boolean False.

IGNOU Help

MCS-024 SOLVED ASSIGNMENT 2019-20

The Relational Operators in Java Programming show in the table given below : Operator

Description

>

greater than

<

less than

>=

greater than or equal to

= b) is = true Output of (a...


Similar Free PDFs