java interview Questions Join Group👌👌👌👌👌👌 https://t.me/javaQuestions4u
Telegram
java interview Questions
java interview questions for beginners
Any promotion for
rajp6133@gmail.com
Any promotion for
rajp6133@gmail.com
Forwarded from java interview Questions
java interview Questions Join Group👌👌👌👌👌👌 https://t.me/javaQuestions4u
Telegram
java interview Questions
java interview questions for beginners
Any promotion for
rajp6133@gmail.com
Any promotion for
rajp6133@gmail.com
Core java Interview Questions for All. Aggregation
Learn java interview questions for student.learn java,core java interview question,java interview question.
Without existing container object if there is a chance of existing contained objects
such type of relationship is called aggregation .
in aggregation objects have weak association.
Example:
Within a department there may be a chance of several professors will work whenever
we are closing department still there may be a chance of existing department object the
relationship between department and professor is called aggregation where the objects
having weak association.
More Questions Visit My Blog 👉👉👉👉👉👉👉👉https://cjavapoint.blogspot.com/
Learn java interview questions for student.learn java,core java interview question,java interview question.
Without existing container object if there is a chance of existing contained objects
such type of relationship is called aggregation .
in aggregation objects have weak association.
Example:
Within a department there may be a chance of several professors will work whenever
we are closing department still there may be a chance of existing department object the
relationship between department and professor is called aggregation where the objects
having weak association.
More Questions Visit My Blog 👉👉👉👉👉👉👉👉https://cjavapoint.blogspot.com/
👍1
Core java interview Questions👉👉👉 Composition
without existing container object if there is no chance of existing contained object
then the relation between container object and contained object is called composition
which is a strong association.
Example:
Any university consists of several departments whenever university object destroys automatically
all the department object will be destroys that is without existing dependent object hence there are associated and this relationship is called composition .more questions visit:- 👍👍👍https://cjavapoint.blogspot.com/
without existing container object if there is no chance of existing contained object
then the relation between container object and contained object is called composition
which is a strong association.
Example:
Any university consists of several departments whenever university object destroys automatically
all the department object will be destroys that is without existing dependent object hence there are associated and this relationship is called composition .more questions visit:- 👍👍👍https://cjavapoint.blogspot.com/
👍1
Forwarded from java interview Questions
Core java interview Questions👉👉👉 Composition
without existing container object if there is no chance of existing contained object
then the relation between container object and contained object is called composition
which is a strong association.
Example:
Any university consists of several departments whenever university object destroys automatically
all the department object will be destroys that is without existing dependent object hence there are associated and this relationship is called composition .more questions visit:- 👍👍👍https://cjavapoint.blogspot.com/
without existing container object if there is no chance of existing contained object
then the relation between container object and contained object is called composition
which is a strong association.
Example:
Any university consists of several departments whenever university object destroys automatically
all the department object will be destroys that is without existing dependent object hence there are associated and this relationship is called composition .more questions visit:- 👍👍👍https://cjavapoint.blogspot.com/
Forwarded from java interview Questions
java interview Questions Join Group👌👌👌👌👌👌 https://t.me/javaQuestions4u
Telegram
java interview Questions
java interview questions for beginners
Any promotion for
rajp6133@gmail.com
Any promotion for
rajp6133@gmail.com
Forwarded from java interview Questions
Core java Interview Questions for All. Aggregation
Learn java interview questions for student.learn java,core java interview question,java interview question.
Without existing container object if there is a chance of existing contained objects
such type of relationship is called aggregation .
in aggregation objects have weak association.
Example:
Within a department there may be a chance of several professors will work whenever
we are closing department still there may be a chance of existing department object the
relationship between department and professor is called aggregation where the objects
having weak association.
More Questions Visit My Blog 👉👉👉👉👉👉👉👉https://cjavapoint.blogspot.com/
Learn java interview questions for student.learn java,core java interview question,java interview question.
Without existing container object if there is a chance of existing contained objects
such type of relationship is called aggregation .
in aggregation objects have weak association.
Example:
Within a department there may be a chance of several professors will work whenever
we are closing department still there may be a chance of existing department object the
relationship between department and professor is called aggregation where the objects
having weak association.
More Questions Visit My Blog 👉👉👉👉👉👉👉👉https://cjavapoint.blogspot.com/
Forwarded from java interview Questions
java interview Questions Join Group👌👌👌👌👌👌 https://t.me/javaQuestions4u
Telegram
java interview Questions
java interview questions for beginners
Any promotion for
rajp6133@gmail.com
Any promotion for
rajp6133@gmail.com
Java program to ReverseString using ByteArrayCore java String 👉👉👉👉👉👉👉👉👉👉👉👉👉/ Java program to ReverseString using ByteArray.
import java.lang.*;
import java.io.*;
import java.util.*;
// Class of ReverseString
class ReverseString
{
public static void main(String[] args)
{
String input = "JavaInterview";
// getBytes() method to convert string
// into bytes[].
byte [] strAsByteArray = input.getBytes();
byte [] result =
new byte [strAsByteArray.length];
// Store result in reverse order into the
// result byte[]
for (int i = 0; i<strAsByteArray.length; i++)
result[i] =
strAsByteArray[strAsByteArray.length-i-1];
System.out.println(new String(result));
}
}
Output:
weivretniavaj More java interview questions and java program visit my blog 👉👉👉👉👉https://cjavapoint.blogspot.com/👈👈👈👈👈👈👈
import java.lang.*;
import java.io.*;
import java.util.*;
// Class of ReverseString
class ReverseString
{
public static void main(String[] args)
{
String input = "JavaInterview";
// getBytes() method to convert string
// into bytes[].
byte [] strAsByteArray = input.getBytes();
byte [] result =
new byte [strAsByteArray.length];
// Store result in reverse order into the
// result byte[]
for (int i = 0; i<strAsByteArray.length; i++)
result[i] =
strAsByteArray[strAsByteArray.length-i-1];
System.out.println(new String(result));
}
}
Output:
weivretniavaj More java interview questions and java program visit my blog 👉👉👉👉👉https://cjavapoint.blogspot.com/👈👈👈👈👈👈👈
core java interview questions
// Java program to Reverse a String by
// converting string to characters one
// by one
import java.lang.*;
import java.io.*;
import java.util.*;
// Class of ReverseString
class ReverseString
{
public static void main(String[] args)
{
String input = "java";
// convert String to character array
// by using toCharArray
char[] try1 = input.toCharArray();
for (int i = try1.length-1; i>=0; i--)
System.out.print(try1[i]);
}
}
Output: avaj for more questions visit👉👉👉👉👉👉👉👉👉👉👉👉👉 https://cjavapoint.blogspot.com/
// Java program to Reverse a String by
// converting string to characters one
// by one
import java.lang.*;
import java.io.*;
import java.util.*;
// Class of ReverseString
class ReverseString
{
public static void main(String[] args)
{
String input = "java";
// convert String to character array
// by using toCharArray
char[] try1 = input.toCharArray();
for (int i = try1.length-1; i>=0; i--)
System.out.print(try1[i]);
}
}
Output: avaj for more questions visit👉👉👉👉👉👉👉👉👉👉👉👉👉 https://cjavapoint.blogspot.com/
HAS-A Relationship
1.HAS-A Relationship is also knows as composition(or) aggregation.
2.There is no specific keyword to implement HAS-A relationship but mostly
we can use new operator.
3.The main advantage of reusability.
Example:-
class Engine
{
// engine functionality
}
class Car
{
Engine e=new Engine();
//------------------------------;
//------------------------------;
//------------------------------;
}
NOTE:-
class car has-a engine reference.
The main dis-advantage of has-a relationship increases dependency between the
components and creates maintains problems. 👌👌👌👌👌👌 More java interview Questions Visit: -https://cjavapoint.blogspot.com/👈👈👈👈👈
1.HAS-A Relationship is also knows as composition(or) aggregation.
2.There is no specific keyword to implement HAS-A relationship but mostly
we can use new operator.
3.The main advantage of reusability.
Example:-
class Engine
{
// engine functionality
}
class Car
{
Engine e=new Engine();
//------------------------------;
//------------------------------;
//------------------------------;
}
NOTE:-
class car has-a engine reference.
The main dis-advantage of has-a relationship increases dependency between the
components and creates maintains problems. 👌👌👌👌👌👌 More java interview Questions Visit: -https://cjavapoint.blogspot.com/👈👈👈👈👈
Core Java Inetrview Questions java Opps Concept What is method overloading in OOP or Java? (answer)
It's one of the oldest OOPS concept questions, I have seen it 10 years ago and still sees it now. When we have multiple methods with the same name but different functionality then it's called method overloading. For example. System.out.println() is overloaded as we have 6 or 7 println() method each accepting a different type of parameter.
What is method overriding in OOP or Java? (answer)
It's one of the magic of object oriented programming where the method is chose based upon an object at runtime. In order for method overriding, we need Inheritance and Polymorphism, as we need a method with the same signature in both superclass and subclass. A call to such method is resolved at runtime depending upon the actual object and not the type o variable. See the answer for more detailed discussion. more Questions Visit https://cjavapoint.blogspot.com/👌👌👌👈👈👈👈
It's one of the oldest OOPS concept questions, I have seen it 10 years ago and still sees it now. When we have multiple methods with the same name but different functionality then it's called method overloading. For example. System.out.println() is overloaded as we have 6 or 7 println() method each accepting a different type of parameter.
What is method overriding in OOP or Java? (answer)
It's one of the magic of object oriented programming where the method is chose based upon an object at runtime. In order for method overriding, we need Inheritance and Polymorphism, as we need a method with the same signature in both superclass and subclass. A call to such method is resolved at runtime depending upon the actual object and not the type o variable. See the answer for more detailed discussion. more Questions Visit https://cjavapoint.blogspot.com/👌👌👌👈👈👈👈
👍1
HAS-A relationship in Java - Learn java
1.HAS-A Relationship is also knows as composition(or) aggregation.
2.There is no specific keyword to implement HAS-A relationship but mostly
we can use new operator.
3.The main advantage of reusability.
Example:-
class Engine
{
// engine functionality
}
class Car
{
Engine e=new Engine();
//------------------------------;
//------------------------------;
//------------------------------;
}
NOTE:-
class car has-a engine reference.
The main dis-advantage of has-a relationship increases dependency between the
components and creates maintains problems.
1.HAS-A Relationship is also knows as composition(or) aggregation.
2.There is no specific keyword to implement HAS-A relationship but mostly
we can use new operator.
3.The main advantage of reusability.
Example:-
class Engine
{
// engine functionality
}
class Car
{
Engine e=new Engine();
//------------------------------;
//------------------------------;
//------------------------------;
}
NOTE:-
class car has-a engine reference.
The main dis-advantage of has-a relationship increases dependency between the
components and creates maintains problems.
👍1
mpre java interview Questions visit https://cjavapoint.blogspot.com/
What is method overloading?
Method overloading is a programming technique that allows developers to use the same method name multiple times in the same class, but with different parameters. In this case, we say that the method is overloaded. Listing 1 shows a single method whose parameters differ in number, type, and order.
Listing 1. Three types of method overloading
Number of parameters:
public class Calculator {
void calculate(int number1, int number2) { }
void calculate(int number1, int number2, int number3) { }
}
Type of parameters:
public class Calculator {
void calculate(int number1, int number2) { }
void calculate(double number1, double number2) { }
}
Order of parameters:
public class Calculator {
void calculate(double number1, int number2) { }
void calculate(int number1, double number2) { }
} more java interview Questions visit https://cjavapoint.blogspot.com/ join my me on https://t.me/javaQuestions4u 👌👌👌👌👍👍👍👍
Method overloading is a programming technique that allows developers to use the same method name multiple times in the same class, but with different parameters. In this case, we say that the method is overloaded. Listing 1 shows a single method whose parameters differ in number, type, and order.
Listing 1. Three types of method overloading
Number of parameters:
public class Calculator {
void calculate(int number1, int number2) { }
void calculate(int number1, int number2, int number3) { }
}
Type of parameters:
public class Calculator {
void calculate(int number1, int number2) { }
void calculate(double number1, double number2) { }
}
Order of parameters:
public class Calculator {
void calculate(double number1, int number2) { }
void calculate(int number1, double number2) { }
} more java interview Questions visit https://cjavapoint.blogspot.com/ join my me on https://t.me/javaQuestions4u 👌👌👌👌👍👍👍👍
❤1
