Menus

Jul 29, 2016

Package and Interface in Java

Course contents:
  1. Content
  2. Defining a package
  3. Access protection
  4. Importing packages
  5. Defining interfaces
  6. Applying interfaces 

An interface is similar to a class that can contain only constants, group of related method signatures, and nested types. There is no method body that is we cannot define methods inside the interface.

Interfaces cannot be instantiated they can only be implemented by classes or extended by other interfaces. Those classes that implement the interface must define the methods that are declared inside the interface. An interface is defined much like class.

The general syntax of interface definition is
Access specifier interface interfacename
{
 return type method-name1(parameter-list);
 return type method-name1(parameter-list);
 return type method-name1(parameter-list);
 return type method-name1(parameter-list);
 type variable-name1 = value;
 type variable-name2 = value;
 ……………..
 …………….
 return type methodnameN(parameter-list);
 type variable-nameN = value;
}
Here, access specifier is optional. When an access sepecifier is not specified then interface is only available to members of the package in which it is declared. When it is declared as public, the interface can be used by any other code.

Java nested class, call-by calue, call-by-reference

Nested class
A class defined within another class is known as nested class. The scope of a nested class is bounded by the scope of its enclosing class. Thus if class B is defined within class A, then B is known to A, but not outside of A.

A nested class (that is inner class) has access to the members, including private members of the class in which it is nested. However, the enclosing class does not have access to the members of the nested class.
WAP that demonstrate the concept of an inner class
class Outer
{
 int outer_x=100;
 void test()
 {
 Inner inn = new Inner();
 inn.display();
 }
 class Inner// this is a inner class
 {
 void display()
 {
 System.out.println("Display:outer_x = " +outer_x);
 }
 }
}

class InnerClassDemo
{
 public static void main(String args[])
 {
 Outer out = new Outer();
 out.test();
 }
}

Jul 25, 2016

Java Inheritance, method overriding, visibility control

Course Contents:
  1. Reference
  2. Super and sub class
  3. Multilevel hierarchy
  4. Method overriding
  5. Dynamic method dispatching
  6. Abstract class


Inheritance
The process of deriving a new class from an old one is called inheritance or derivation. The oldclass is referred to as the base class or super class or parent class and new one is called the derived class or subclass or child class. 

The derived class inherits some or all of the properties from the base class. A class can inherit properties from more than one class or from more than one level. The main purpose of derivation or inheritance is reusability. Java strongly supports the concept of reusability. 

The Java classes can be reused in several ways. Once a class has been written and tested, it can be used by another by another class by inheriting the properties of parent class.

Defining a subclass

A subclass can be defined as follows:
class subclassname extends superclassname
{
 Variable declaration;
 Method declaration;
}
The keyword extends signifies that the properties of the superclassname are extended to the subclassname. 

Jul 23, 2016

Introduction to Java Class and Object

Course Contents:
  1. Form of class
  2. Objects declaration
  3. Methods
  4. Constructors
  5. This keyword
  6. Garbage collection


Class
A class is a user defined data type that is used to define its properties. A class consists of data member and member functions. The data or variables defined within a class are called instance variables because each instance of the class (that is each object of the class) contains its own copy of these variables.

The functions defined or declared within the class are known as methods. The method and variables defined within a class are called member of the class. In class the data for one object is separate and unique from the data for another.

The general syntax of class definition is:
Class classname
{
 Type instance_variable1;
 Type instance_variable2;
 ………;
 ……….;
 Type methodname(parameter list)
{
 //body of the method
}
Type methodname(parameter list)
{
 //body of method
}
 …………..
 Type method(parameter list)
 {
 //body of method
}
}

Jul 22, 2016

Java Operators and Control Statements

Course Contents:

  1. Arithmetic operators
  2. Bitwise operator
  3. Boolean logical operator
  4. Relational operator
  5. Assignment operator
  6. The ?: Operator
  7. Operator precedence
  8. Java selection statements
  9. Iteration statements
  10. Jump statements

Operator

An operator is a symbol that tells the computer to perform certain mathematical or logical manipulations. Operators are used in programs to manipulate data and variables. Java operators can be classified into a number of related categories as below:

1. Arithmetic operators
Arithmetic operators are used in mathematical expressions in the same way that they are used in algebra. The following are the arithmetic operators:
+, -, *, /, %, ++, +=, -=, *=, /=, %=, --.

The operands of the arithmetic operators must be of a numeric type.

Jul 20, 2016

Java Data types, Variables and Arrays

Course Contents:

  1. Integers
  2. Floating-point
  3. Characters
  4. Boolean
  5. Variables
  6. Declaration
  7. Dynamic initialization
  8. The scope and lifeline of variables
  9. Type casting

Variable

A variable is an identifier that denotes a storage location used to store a data value. A variable takes different value at a different time during program execution.

Rules for constructing variable in Java
- They must not begin with a digit.
- Uppercase and lowercase are distinct. This means that Sum is not the same as sum and SUM.

- It should not be a keyword.
- White space is not allowed.
- Variable length can be of any length.

Jul 17, 2016

Introduction to java

Course Contents:
  1. Introduction
  2. History and development of java
  3. Platform independence
  4. Byte code
  5. Object-oriented characteristics
  6. How to write and execute?

History and development of Java
Year
Development
1990
Sun Microsystems decided to develop special software that could used to manipulate consumer electronic devices.
1991
After exploring the possibility of using the most popular object-oriented language C++, the team of Sun Microsystems announced a new language “OAK”.
1992
They use their new language to control a list of home appliances using hand held devices with a tiny touch sensitive screen.
1993
The team came up with idea of developing web applets (tiny programs) using the new language that could run on all types of computers connected to internet.
1994
The team developed a web browser called “HotJava” to locate and run applet program on internet. This becomes the most popular among the internet users.
1995
Oak was renamed “Java”. Java is just a name not an acronym and many popular companies like Netscape and Microsoft also support this language.

Jul 16, 2016

How to solve Error:(23, 17)"Failed to resolve: junit:junit:4.12" in Android Studio





Make sure that you are connected to internet.

Expand the Gradle Scripts

Double click on build.gradle (Module: app)

And paste following code below line apply plugin: 'com.android.application'
repositories {
    maven { url 'http://repo1.maven.org/maven2' }
    jcenter { url "http://jcenter.bintray.com/" }
}


Run your project and now it should work.

Jul 2, 2016

Explain System Analysis and Design

Unit 1: The Context of System Analysis and Design

Introduction
Systems are created to solve the problems. A system approach in any field can be defined as an organized way of dealing with a problem. A system can be defined as a collection of components that work together to achieve some objectives. Basically there are three major components in a system, input, processing and
output.
Fig: Basic System Components
System Analysis and Design (SAD) is a formal approach in system development that deals with systematic analysis of all the requirements and carrying out the systematic design taking into considerations of all the available resources.

Contact Form

Name

Email *

Message *