Question
Which option most fully describes will happen when you attempt to compile and run the following code

public class MyAr{


public static void main(String argv[]) {
MyAr m = new MyAr();
m.amethod();
}
public void amethod(){
static int i;
System.out.println(i);
}


}



1) Compilation and output of the value 0

2) Compile time error because i has not been initialized

3) Compilation and output of null

4) Compile time error

Answers



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

Can variables be used in Java without initialization?

What is the difference between java bean and enterprise java bean?

What is software configuration management?

How does the java database connectivity (jdbc) work?

What are the advantages of threads in java?

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?

What is object cloning in Java?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?



Search
Can you Answer!!
  • Q How to select a character from a string? for example: string str = "Hello"; from the above string how to get the first letter into char c;
  • Q What is the use of Transient Keyword ?
  • Q The power to amend the Indian Constitution vests in the:
  • Q Where did India play its 1st one day international match?
  • Q Full form of MRI?
  • Q The first Co-operative minister in Kerala?
  • Q Name the inflorescence found in Linaceae family?
  • Q What is the difference between API Testing and Unit Testing?
  • Q What are overlays in framework7?
  • Q Lines traditionally in a sonnet?
  • Q Visvesvaraya Ind & Technology Museum is located in