Skip to main content

Popular posts from this blog

XML TECHNOLGY FAMILY #3 - Advantages of XML Over HTML, EDI, Databases

Advantages of XML Over HTML , EDI , Databases

PROGRAMMING IN JAVA ||UNIT 1- DECLARATIONS AND ACCESS CONTROL||JAVA IDENTIFIERS & KEYWORDS

 II BCA -  CORE PAPER 3 PROGRAMMING IN JAVA UNIT 1- DECLARATIONS AND ACCESS CONTROL JAVA IDENTIFIERS & KEYWORDS Java Identifiers ·         An Identifiers is a name given to program elements such as class, variable, field, method, or constructor. ·         In Java programming language an identifier is a sequence of alphabets or digits. ·         The two aspects of Java identifiers are o    Legal identifiers: The rules the compiler uses to determine whether a name is legal. o    Oracle's Java Code Conventions:   Oracle's recommendations for naming classes, variables, and methods. Legal Identifiers Technically, legal identifiers must be composed of only Unicode characters, numbers, currency symbols, and connecting characters (such as underscores). The rules for Legal Identifiers: o    Identifiers must start with a letter, a currency character ( $ ), or a connecting character such as the underscore ( _ ). o    Identifiers cannot start with a digit! o   

Java Program to implement inheritance || Java Programming Lab Exercise 2.1

  IMPLEMENTATION OF INHERITANCE What is Inheritance ? Ø   The process by which one class acquires the properties(data members) and functionalities(methods) of another class is called  inheritance . Ø   The aim of inheritance is to provide the reusability of code so that a class has to write only the unique features and rest of the common properties and functionalities can be extended from the another class. Aim:             To write a java program to implement the concept of inheritance. Procedure: Open text editor(notepad) Create a base class called “StudentBase” Declare & define department, collegeName as private data members of string datatype. Since the private data members cannot be   accessed directly, we are using public getter & setter methods   to access the private members of base class Create a derived class called “StudentDerive” that extends the base class “StudentBase” Declare & define regNo, sName as default data members of string datatype.