who can we create the object of a class? in how many ways we
can create it (max 5)

Answer Posted / ravi jain

through

1) String s = "This is my Object";

2) String s1 = s.subString(1,8);

3) int[] arr = {12,45,12}; every array is an object.

4) String s2 = s + s1;

these all are also create new instances.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is Gang of four design patterns

810


What is rule of accessibility in java?

766


What does the “static” keyword mean? Can you override private or static method in java?

826


Explain the difference between map and flatmap stream operation?

1035


Why we override equals() method?

782


What is a function argument in java?

771


What is difference between null and void?

734


What does jre stand for?

811


What is the hashcode () and equals () used for?

733


Which collection allows duplicate values in java?

747


How do you write a conditional statement?

709


Why vector is used in java?

770


Can we override private method?

812


Difference between a process and a program?

824


What are the four versions of java?

771