package LearnJava;
public class TestReturnTypeInJava {
void test1() {
System.out.println("I have void return type");
}
public int test2(int a) {
System.out.println("I am returning integre value");
return a;
}
boolean test3() {
System.out.println("I am returning boolen value");
return true;
}
public TestReturnTypeInJava test4() {
return this;
}
char test5() {
return 'c';
}
double test6(int a, int b) {
return a + b;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
TestReturnTypeInJava obj = new TestReturnTypeInJava();
obj.test1();
int c = obj.test2(7);
boolean d = obj.test3();
}
}
public class TestReturnTypeInJava {
void test1() {
System.out.println("I have void return type");
}
public int test2(int a) {
System.out.println("I am returning integre value");
return a;
}
boolean test3() {
System.out.println("I am returning boolen value");
return true;
}
public TestReturnTypeInJava test4() {
return this;
}
char test5() {
return 'c';
}
double test6(int a, int b) {
return a + b;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
TestReturnTypeInJava obj = new TestReturnTypeInJava();
obj.test1();
int c = obj.test2(7);
boolean d = obj.test3();
}
}
Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
ReplyDeleteCore Java Training in Electronic city