Question
There are two array objects of int type. one is containing 100 elements and another one is containing 10 elements. Can you assign array of 100 elements to an array of 10 elements?

Answers

Yes, you can assign array of 100 elements to an array of 10 elements provided they should be of same type. While assigning, compiler checks only type of the array not the size.

public class MainClass
{
public static void main(String[] args)
{
int[] a = new int[10];
int[] b = new int[100];
a = b; //Compiler checks only type, not the size
}
}   Your Comment




More Software Questions..
What is the inputsplit in map reduce software?

What is software configuration management?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?

What are the minimum system requirements to run Photoshop? Is it possible to run Photoshop over linux?

Which oracle package is used to manage the oracle lock management services?

What is Latch Up? Explain Latch Up with cross section of a CMOS Inverter. How do you avoid Latch Up?

What is marker interface?

What types of partitioning are there for BW?



Search
Can you Answer!!
  • Q To set all checkboxes to true using javascript?
  • Q Which was the first Road film featuring Bing Crosby and Bob Hope?
  • Q Which function is used for sorting in r?
  • Q Name the journalist and writer and leader of the influential Work Foundation research organization, bought by Lancaster University in 2010?
  • Q How soon after exposure can HIV infection be detected?
  • Q ‘Kandla’ situated on the Gulf of Kachchh is well known for which purpose?
  • Q Which vitamin helps in blood clotting?
  • Q By whom was capital of the Mughal Empire shifted from Agra to Delhi?
  • Q Describe common problems of test automation.
  • Q What are the business service events?
  • Q What is the displayed part and work part. Where does it come?