Posts

Showing posts from April, 2018

OOPs Concepts

Image
OOPS (Object Oriented Programming Structures) What is Abstraction? Abstraction is the concept of hiding irrelevant (not related to the task) details.In other words, make complex/typical system simple by hiding the unnecessary detail from the user and make it user-friendly. The abstract class specifies what functionality is provided but not how that functionality is provided. For example, one does not want to understand how the engine works. Similarly one does not have to understand the internal implementation of the software objects. Abstraction provides a way to hide the less essential properties so as to reduce complexity and increase efficiency. Abstraction Example: Engine and Driver. What is Encapsulation? Encapsulation is the technique of making the fields in a class private and providing access to the fields through public methods. Encapsulation is also called as data hiding. The benefits of encapsulation: The capability of changing\updating your code without di...

Creating of the stack using array

Image
//Creating of stack using ArrayStack #include<stdio.h> #include<conio.h> struct ArrayStack { int top, capacity; int *array; }; struct ArrayStack* createStack(int cap) { struct ArrayStack *stack; stack=malloc(sizeof(struct ArrayStack)); stack->top=-1; stack->capacity=cap; stack->array=malloc(sizeof(int)*stack->capacity); return(stack); } int IsFull(struct ArrayStack *stack) { if(stack->top==stack->capacity) return(1); else return(0); } int IsEmpty(struct ArrayStack *stack) { if(stack->top==-1) return(1); else return(0); } void Push(struct ArrayStack *stack,int item) { if(!IsFull(stack)) { stack->top++; stack->array[stack->top]=item; } } int Pop(struct ArrayStack *stack) { int item; if(!IsEmpty(stack)) { item=stack->array[stack->top]; stack->top--; return(item); } else return(-1); } main() { int choice, item, c; struct ArrayStack *stack; clrscr(); printf("\nEnter the capacity ...

Data types and keywords in JAVA

Image
DATA TYPES AND KEYWORDS IN JAVA Data types:- ·       A data type identifies all set of values (their representation in memory) and all the set of operations that transform these values into other values of that set it is called data types. ·       Java is a strongly typed language. Types:- ·       There are two types of data types- o   Primitive data types (int, char and so on) o   Users define data types (class etc.) Primitive type:- Type Size boolean Implementation dependent char 16 bits (stores Unicode) byte 8 bits short 16 bits int 32 bits long 64 bits float 32 bits double 64 bits Variables:- ·       It is a type of container which holds any data/information/value. ·       Every variable must...

Introduction Of JAVA

Image
INTRODUCTION OF CORE-JAVA Core JAVA Ø It is a breed of coffee. Ø Java developers want to think about name “oak” instead of java but it is already a name of anything. Ø Java was developed by James Gosling at SUN MICROSYSTEM, Inc. in 1982. Ø On Jan. 27, 2010 Sun was acquired by Oracle Corporation for US $7.4 billion. Ø Thus, Java is a product of Oracle. Ø Its World’s Popular and Secure language. Ø It is High level language. Ø Its works on 3 billion devices. Slogan of JAVA Ø      JAVA is everywhere. Ø      JAVA resides in mobiles, client machines, server machines, embedded devices, smart phones, cloud etc. Ø      It shares the same basic features of the language and libraries. Principle of JAVA Ø Write once, Run everywhere. What is Library? Ø      JAVA library is a collection of pre-defined classes. Flavors of JAVA Ø JAVA Standard Edition (SE) (...