Java programming language questions and answer with solution

Basic knowledge in Java programming language. (q) Which is false about java programming language? (a) Java is high level programming language. (b) Java is a platform. (c) javac is compiler. (d) Byte code is executed by CPU. Answer: (d) (q) Which are not characteristics of java programming language? (a) Robust (b)Procedural (c) Distributed (e) Multithreaded Answer: (b) (q) Which is true about of java hotspot virtual machine? (a) It is additional virtual machine which improves the performance of an application. (b) It is internal device which convert source code into byte code. (c) It is virtual machine which detects runtime exception. (d) All are true. Answer : (a) (q) Which of the following are correct? (a) Java platform is software only platform that runs on the top of other hardware based platform. (b) Java platform has two components: JVM, API. (c) Java technology is programming language as well as platform. (d) All of the above. Answer : (d) (q) Which of them are not command line tools? (a) java (b) javaw (c) javapath (d) javadoc Answer : (c) (q) Which of the about main method? (a) Must be declared as public. (b) It must not return any value. (c) Must be declared as static. (e) Must accept string as a parameter. (f) Above all are compulsory. (g) All are optional. Answer : (f) (q) Which not true about API? (a) API stands for application package interface. (b) It is large collection of software components. (c) It is large array of useful class. (d) It is grouped into the package of related class. Answer : (a) (q) Which of the following is correct? (a) class MainClass { static public void main(String[] args) { System.out.println("Hello World!"); } } (b) class MainClass { public static void main(String[] args) { System.out.println("Hello World!"); } } (c) class MainClass { static public int main(String[] args) { System.out.println("Hello World!"); return 1; } } (d) Both option (a) and (b) Answer : (d) (q) Which of the following is false? (a) Java platform is bit faster than actual CPU platform. (b) javac is compiler tool. (c) java command launch an application. (d) javadoc is documentation tool. Answer : (a) (q) What is difference between following two commands? (i) java ClassName (ii)javaw ClassName where ClassName.class is name of any class file. (a) Execution time of (i) is faster than (ii) (b) (i) is used to run in server machine while (ii) is used to run in client machine. (c) (ii) is used to run in server machine while (i) is used to run in client machine. (d) (i) has console window while (ii) has not any console window. Answer : (d) (q) If any class file Binary.class is zipped in Binary.zip in c:\Test.Which of the follwing command line command is suitable to execute the zip file? (a) java –classpath c:\Test\Binary.zip Binary (b) java –cp c:\Test\Binary.zip Binary (c) javaw –classpath c:\Test\Binary.zip Binary (d) javaw –cp c:\Test\Binary.zip Binary (e) All of them are correct. Answer : (e) (q) How can set the path of class folder at a time in command prompt? (i) c:\test (ii) Current working directory. (a) set classpath=c:\test;. (b) set -cp=c:\test;. (c) path=c:\test;. (d) PATH=. ; c:\test Answer : (a) (q) If Binary.class is available in both of following directory (i) c:\test (ii) d:\raja Which of them are true if follwing command is executed in command prompt? set cp=c:\test;d:\raja java Binary (a) Binary.class persent in test folder will execute only. (b) Binary.class persent in raja folder will execute only. (c) Binary.class persent in test and raja folder both will execute. (d) It will depend upon o.s default option. Answer : (a)

13 comments:

geethu said...
This comment has been removed by the author.
Paul Miller said...

As the demand of java programming application keeps on increasing, there is massive demand for java professionals in software development industries. Thus, taking training will assist students to be skilled java developers in leading MNCs.Best Java Training in Chennai | JAVATraining Institutes in Chennai|JAVA Training

Mathew Stephen said...

For management and troubleshooting of enormous databases, corporation’s square measure searching for qualified and licensed dispersions Hadoop experts for the duty. Hadoop Training in Chennai | Hadoop Training Chennai

Paul Miller said...

In coming years, cloud computing is going to rule the world. The cloud based CRM tool provider like Salesforce have massive demand in the market. Thus talking Cloud Computing Training in Chennai from reputed Cloud Computing Courses will ensure bright career prospects for aspiring professionals.

Rasool Bevi said...

Excellent post!!! The future of cloud computing is on positive side. With most of the companies integrate Salesforce CRM to power their business; there is massive demand for Salesforce developers and administrators across the world.Salesforce Training in Chennai | Salesforce Training Institutes in Chennai

Paul Miller said...

Excellent post!!! The future of .net application development is on positive note. It offers huge career prospects for talented professionals all over the world. Training on .net technology will ensure good salary package. Best DOT NET Training in Chennai | .NET Course in Chennai

Paul Miller said...

These questions are really useful :)
Regards,

Android training|Android Training in Chennai

Unknown said...

Thanks for your informative post on Java application development. This open source platform assists software developers to create stunning mobile application with ease. Further, they can make use of this platform at free of cost. Best Java Training in Chennai | Best JAVA Course in Chennai

Amirtha rao said...

The expansion of internet and other business intelligence leads to large volume of data. Industries are looking for talented professionals to maintain and process huge volume of data with latest tools available in the market. Taking Hadoop Training in Chennai | Big Data Training in Chennai will ensure better career prospects for talented professionals.

Paul Miller said...

Thanks for splitting your comprehension with us. It’s really useful to me & I hope it helps the people who in need of this vital information.
Best DOT NET Training institute in Chennai|DOT NET Training Chennai

Melisa said...

Excellent post!!! In this competitive market, customer relationship management plays a significant role in determining a business success. That too, cloud based CRM product offer more flexibility to business owners to main strong relationship with the consumers. Salesforce Training Institutes in Chennai| Salesforce Training Institutes in Chennai

Jhon David said...

I went through your blog and it’s totally awesome. Keep on updating your site with such informative post. If possible please include rss feed for your blog. Web designing Course in Chennai

Melisa said...

Excellent post!!! In this competitive market, customer relationship management plays a significant role in determining a business success. That too, cloud based CRM product offer more flexibility to business owners to main strong relationship with the consumers. Cloud Computing Training in Chennai | Cloud Computing Courses