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

How many bits are in a sentence?

820


What is JFC?

918


What happens to a static var that is defined within a method of a class?

801


Explain about field hiding in java?

734


Is singleton class immutable?

744


How many bytes is a unicode character?

755


Which sorting algorithm is in place?

744


Can we use synchronized block for primitives?

850


What’s meant by anonymous class?

858


How do you sort a string in alphabetical order in java?

759


Explain inner classes ?

904


Which data type is a class in java?

785


What is method in java with example?

714


What is Garbage Collection in Java

853


State the main difference between c++ and java?

814