Java Library

Java Library Contact information, map and directions, contact form, opening hours, services, ratings, photos, videos and announcements from Java Library, Library, sathupally, Hyderabad.

Java Library is the page for learning and sharing our experience in real time scenario,how those problems we solved.its helps to all who learning and working java related languages.

11/04/2021

We can write abstract class with all unimplemented methods like interface...
Then can we replace interface with abstract class, if not why ?

Free   Course :‬‪Complete Python 3 Course.‬‪Use Code 43ABBC183C3A7E38B840‬‪Link :
10/04/2020

Free Course :‬

‪Complete Python 3 Course.‬

‪Use Code 43ABBC183C3A7E38B840‬

‪Link :

https://howtodoinjava.com/java8/lambda-expressions/
09/07/2019

https://howtodoinjava.com/java8/lambda-expressions/

In programming, a Lambda expression (or function) is just an anonymous function, i.e., a function with no name and without being bound to an identifier. In other words, lambda expressions are nameless functions given as constant values, and written exactly in the place where it's needed, typically a...

27/09/2016

JAVA 8 new Feature Lambda expressions
------------------------------------------------------
A lambda is a function
Until java 8, function could only be implemented using methods,
A lambda enables function to be passed around
Lambda expression adds that missing link of functional programming to Java.
Lambda expressions helps to write very simple code
Especially useful in places where a method is being used only once, and the method definition is short.
It saves you the effort of declaring and writing a separate method to the containing class.

How lambda works with Example
------------------------------

1) Normal implementaion of an interface
-------------------------------------------------
interface FirstLambda{
public void sayHello();
}

class LambdaImpl implements FirstLambda{


public void sayHello() {
System.out.println("Welcome to Lambda Example");

}

}
public class LambdaMain {

public static void main(String[] args) {

FirstLambda inst=new LambdaImpl();
invoke(inst);
}

public static void invoke(FirstLambda inst){
inst.sayHello();
}

}

2) We can implement this by using annonamus class implimentation
----------------------------------------------
interface FirstLambda{
public void sayHello();
}
public class LambdaMain {

public static void main(String[] args) {

FirstLambda inst=new FirstLambda(){
public void sayHello() {
System.out.println("Welcome to Lambda Example");

}
};
invoke(inst);
}

public static void invoke(FirstLambda inst){
inst.sayHello();
}

}

3)By using lambda expression
--------------------------------------
interface FirstLambda{
public void sayHello();
}

public class LambdaMain {

public static void main(String[] args) {

FirstLambda inst=() -> System.out.println("Welcome to Lambda Example");
invoke(inst);

};

public static void invoke(FirstLambda inst){
inst.sayHello();
}

}

15/11/2014

Assume......Think...

java class == our house Enviroment
in our house we contain no of things like
plates,bowls,glasses,windows,doors,key loker,cycle,bike,car...etc
father,mother,brother,sister,grand fathr,grand mother....etc

as well as in class

variables,methods,method parameters,static variables,access modifiers (public ,private..)

here.....

class{ class is home and { & } compound wall of house

}

if you have friend ,he comes to your house with or without your/gate keeper permission i.e access /or not access

unkown person before coming in to your house ,he should permit from you ....so what here i am saying is

i wann going in to class ,jre(java runtime environment) checks is this class is public or private

example:

public class ABC {

}

//this class will be access your friend/ any unkown person

private class ABC {

}
// no one can not access this class

as well as

public class ABC {

private String name;
// this is variable declaration {String is the declaration data type is group of charecters ex: java is string
here i assign name is java.
//And this is declare as private we can't this variable

name="JAVA";

puclic setName(String name){
this.name=name;
}
public String getName(){
return this.name;
}

public static void main(String args[]){

ABC abc=new ABC(); this is instance creation ,and this instance is refferce to abc

abc.name; compile error

System.out.print("we cant access the abc.name value.."+abc.name);

abc.getName(); // now we can get name
}
}

// home is public like class... but bike is private variable like name think in this way....ok
person
in real life if you want to use friends bike....
1st you should get permission from your friend as well as we use getName() method

Think in this way practically.....

IF you really like and understood like and share it.. :) :) :)

03/02/2013

PC Register(Program Counter):It will contains the address of next instruction that has to be executed.

03/02/2013

JavaStack:it can be used storing the information about methods,under execution,this can be consider as the combination of stack frames every frame contains the state of a single method

03/02/2013

Heap Area:it can be used for storing the Objects that are created

03/02/2013

Method Area:This can be used for storing the class code and method code.

03/02/2013

Byte code will be located in different areas at run time.

Address

Sathupally
Hyderabad

Telephone

9985797170

Website

Alerts

Be the first to know and let us send you an email when Java Library posts news and promotions. Your email address will not be used for any other purpose, and you can unsubscribe at any time.

Share

Category