Friday, December 30, 2016

android_apps_usb_real_device

About 1 week to run android studio 2.2 installed. But I could not install or did not know how to installed usb driver software.

now I am going to show you how to configure USB in android Studio.

1. First installed Android Studio in developer website.
2. Menu bar in android studio.
 
     tools -> sdk manager


then searching Usb google drive and mark this option and installed .

then
computer manager Device and configure .. C: drive user->android-> SDK where google driver software . installed properly
click here


install-spreadtrum-usb-driver-manually

vedio



Sunday, December 25, 2016

java class object

জাভা প্রোগ্রামিং - class and object

Monday, December 19, 2016

super keyword use in Java || জাভায় super কিওয়ার্ড ব্যবহার

জাভায় super কিওয়ার্ড ব্যবহার

java super কিওয়ার্ড  ব্যবহার করা হয় parent class এর object .

super কিওয়ার্ড ব্যবহার:
  1. super is used to refer immediate parent class instance variable.
  2. super() is used to invoke immediate parent class constructor.
  3. super is used to invoke immediate parent class method.


super is used to refer immediate parent class instance variable

// base class Vahicle
class Vahicle{
int maxspeed = 300;
}
//sub class Car extending vahicle
class Car extends Vahicle{
int maxspeed = 500;
void display(){
// print the max speed of base class
System.out.println("Max Speed subclass "+maxspeed);
System.out.println("Max Speed"+super.maxspeed);
}
}
// Driver program to Myclass
class MyClass{
public static void main(String args[]){
Car obj = new Car();
obj.display();
}
}



super() is used to invoke immediate parent class constructor.

/* superclass Person */
class Person
{
Person()
{
System.out.println("Person class Constructor");
}
}
/* subclass Student extending the Person class */
class Student extends Person
{
Student()
{
// invoke or call parent class constructor
super();
System.out.println("Student class Constructor");
}
}
/* Driver program to MyClass*/
class MyClass
{
public static void main(String[] args)
{
Student s = new Student();
}
}


super is used to invoke immediate parent class method

/* Base class Person */
class Person
{
void message()
{
System.out.println("This is person class");
}
}
/* Subclass Student */
class Student extends Person
{
void message()
{
System.out.println("This is student class");
}
// Note that show() is only in Student class
void show()
{
// will invoke or call current class message() method
message();
// will invoke or call parent class message() method
super.message();
}
}
/* Driver program to MyClass */
class MyClass
{
public static void main(String args[])
{
Student s = new Student();
// calling show() of Student
s.show();
}
}

Sunday, December 18, 2016

final keyword use in java || জাভায় final কিওয়ার্ড ব্যবহার

 জাভায় final কিওয়ার্ড ব্যবহারঃ


জাভায় final কিওয়ার্ডটি বিভিন্ন contexts এ ব্যবহার করা হয়। জাভায় final কিওয়ার্ড ব্যবহারে সীমাবদ্ধ করে দেয় একজন ব্যবহারকারিকে । final হতে পারে।
১. Variable
২. Method
৩. Class
১. final Variable:  একটি final variable একবারই assign করা হয়। যদি final variable টি একবার রেফারেন্স করে দেওয়া হয় তাহলে অন্য কোন object দিয়ে পুনরায় ঐ variable কে re-bound হতে পারে না।
উদাহরণ দেখা যাকঃ-
class Main{
public static void main(String args[]){
final int variable = 30; // final variable
variable=43;
}
}



বিঃদ্রঃ c++ const variable এবং জাভা final variable এর মধ্যে পার্থক্য আছে। সি ++  const variable  যখন ডিক্লার করা হয় তখনই assign করে দিতে হয়। কিন্তু জাভার ক্ষেত্রে final variable assign প্রথমে না করলে হবে এটার প্রয়োজন নাই। তবে পরবর্তীতে assign করা যায়। অব্যশই একবার assign করতে হবে।
নিচের উদাহরণটি লক্ষ্য করা যাকঃ-

class Main{
public static void main(String args[]){
final int variable; // final variable kyeword
variable=43; // assigning later final variable
System.out.println(variable);
}
}

Final Mehod: একটি final method কে subclass দ্বারা overridden করতে পারা যায় না।
আমারা যদি subclass দ্বারা final method কে  overridden করতে যায় সেক্ষেত্রে ভুল গুলো নিচের প্রোগ্রামে লক্ষ্য করি।
class Base{
public final void display(){ // final keyword use
System.out.println("Base:: display() called");
}
}
class Derived extends Base{
public void display(){ // error here
System.out.println("Derived:: display() called");
}
}
class FinalMeDemo{
public static void main(String args[]){
Base b = new Derived();
b.display();
}
}


Final class: final class কে সম্প্রাসারিত  (inherited) করতে পারা যায় না।
নিচের প্রোগ্রামটি লক্ষ্য করিঃ-

//
final class Base{ // final keyword use in class
public final void display(){
System.out.println("Base:: display() called");
}
}
class Derived extends Base{
public void display(){ // error here
System.out.println("Derived:: display() called");
}
}
class FinalMeDemo{
public static void main(String args[]){
Base b = new Derived();
b.display();
}
}
view raw finalClass.java hosted with ❤ by GitHub

লেখার মধ্যে কিছু ভুল হলে আমাকে comment করেন জানাবেন। এছাড়া উপরের আলোচিত টপিক্স আর উপর আরও তথ্য আমাকে শেয়ার করতে পারেন।
ভাল থাকুন অন্য কোন topics নিয়ে অন্য কোন সময় আলোচনা করা হবে।

Tuesday, December 13, 2016

Java Basic -How JVM Works – JVM Architecture?

JVM(Java Virtual Machine) acts as a run-time engine to run Java applications. JVM is the one that actually calls the main method present in a java code. JVM is a part of JRE(Java Run Environment).
Java applications are called WORA (Write Once Run Everywhere). This means a programmer can develop Java code on one system and can expect it to run on any other Java enabled system without any adjustment. This is all possible because of JVM.
When we compile a .java file, a .class file(contains byte-code) with the same filename is generated by the Java compiler. This .class file goes into various steps when we run it. These steps together describe the whole JVM.



Image Source : https://en.wikipedia.org/wiki/Java_virtual_machine



class Test{
public static void main(String args[]){
Student s1 = new Student();
Class c1 = s1.getClass();
//getting class by creating JVM
System.out.println(c1.getName());
//Method m[] = c1.getDeclaredMethods();
// for (Method method : m)
// System.out.println(method.getName());
// Field f[] = c1.getDeclaredFields();
// for (Field field : f)
// System.out.println(field.getName());
// String class is loaded by bootstrap loader, and
// bootstrap loader is not Java object, hence null
System.out.println(String.class.getClassLoader());
// Test class is loaded by Application loader
System.out.println(Test.class.getClassLoader());
}
static class Student{
private String name;
private int roll;
public void setName(String name){
this.name = name;
}
public String getName(){
return name;
}
public int getRoll(){
return roll;
}
public void setRoll(int r){
this.roll = r;
}
}
}
view raw JvmWorks.java hosted with ❤ by GitHub