Trending ▼   ResFinder  

computer notes

9 pages, 10 questions, 3 questions with responses, 5 total responses,    5    0
Pranayak Uniyal
City Montessori School (CMS Aliganj Campus I), Lucknow
+Fave Message
 Home > pranayak >

Formatting page ...

Definitions Abstraction : it is the act of representing essential features and hiding the background details. Encapsulation: it is an act of wrapping of the data and function as one single unit. Provides insulation of the data from the direct access by the program . Inheritance : it is the capability of one class to inherit the properties from another class Polymorphism: it is the ability of data to be processed in more than one form Variables A variable is defined as a location in the memory of the computer where the values are stored. (Or) it is a letter or a word used to represent a value Various types of variables: Instance variables, class variables and local variables Scope of a variable: Instance Variable/non static variables : are created when the objects are instantiated and therefore they are associated with the objects. They take in different values for each object. Class Variable/static variable: are local to a class and belong to the entire set of objects that class creates. Only one memory location is created for each class variable. Local variables: variables declared and used inside methods are called local variables. They are called so because they are not available for use outside the method definition. A constant is the value stored in a variable and remains the same during the execution of a program. Operators: a symbol used to depict a mathematical or logical operation. Symbolic constant/ Keyword - Final : Sometimes we might want a variable to behave like a constant. For example the value of pi=3.14. if we add the word final then the variable will behave like a constant. Eg. final float pi=3.14. Arithmetic operators: they provide facilitation to the mathematical calculations within a program: they are + - * / % Assignment operators: These operators are used to assign the value of an expression to a variable : = Shorthand operators : allows ease while programming instructions and feature with all the available operators with two operands : += -= *= /= %= Relational operators: provide facilitation for comparing numbers and characters for calculation and do not function with strings.: > < <= >= == != Increment operator : is used to increment the variable by 1: ++ Logical operators: used to conduct the logical combination of Boolean values within a program.: && || ! Expression : is a combination of operators, constants and variables. Type conversion: conversion of defined type variable into another type. The process of conversion of one data type to another is called casting. Explicit type conversion: The process of converting one predefined type into another is called type conversion it includes conversion of data according to the specification by the user. also called as type casting :eg int x= 65; char c = (char) x; it is called type casting. Implicit type conversion: The process of converting one predefined type into another is called type conversion.It is performed invisible and hence known as automatic conversion. When two operands of different types are encountered in the same expression the lower type variable is converted to the type of the higher type variable automatically and is also known as type promotion.: byte x=8; int y=x; it is called coercion. Ternary operator: Excellent substitute to the control statement like if statement. syntax: value variable = (test expression): expression 1: expression 2; it the test expression is true then the variable takes expression 1 as its value whereas if it is false then it takes expression2. Final: The keyword final makes a variable as constant. i.e. whose value can not be changed during the program execution 1

Formatting page ...

Top Contributors
to this ResPaper
(answers/comments)


Siddhi K.

(1)

Yesha Kadakia

(1)

ResPaper Admins

(1)

Rick Biswas

(1)

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

 

  Print intermediate debugging step

Show debugging info


 

 

© 2010 - 2024 ResPaper. Terms of ServiceContact Us Advertise with us

 

pranayak chat