UrbanPro

Learn Java Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

What will be the output of the program? public class Test { public static int y; public static void foo(int x) { System.out.print("foo "); y=x; } public static int bar(int z) { System.out.print("bar "); return y=z; } public static void main(String [] args ) { int t=0; assert t > 0 : bar(7); assert t > 1 : foo(8); /* Line 18 */ System.out.println("done "); } } A. bar B. bar done C. foo done D. Compilation fails

Asked by Last Modified  

13 Answers

Learn Java

Follow 0
Answer

Please enter your answer

Compiler error on line 18. You can't call method in assert with void return type.
Comments

Training Centre

D. Compilation fails
Comments

Core Java, Spring, Hibernate

D. Compilation fails
Comments

Most Advanced Java training in Ahmedabad

D
Comments

Java/J2EE, B.E./B.Tech/MCA SubjectsTraining

D
Comments

Java Trainer

D
Comments

IT Professional Trainer with 15 years of experience in IT Industry

D
Comments

Expert in J2ee, SDLC and Telecom Project

D, Compilation fail, as in line 18, required to return something.
Comments

Mathematics,Computer Science and Engineering

D
Comments

Oracle certified Java programmer having 7 yrs of work e xperience

Compiler error on line 18. You can't call method in assert with void return type.
Comments

View 11 more Answers

Related Questions

How can I execute a Java program?
Through command-line 1.compile the code using javac filename.java 2. Finally run the code using java filename here filename is classname. If u use eclipse then right click the java code n select run as java application .
Suresh
0 0
5
How does Java implement polymorphism?
Java implements polymorphism in two ways: 1. Static or compile-time polymorphism is done by method overloading (more then one methods sharing the same name but different number/types/order of parameters) 2....
Sajjan
0 0
6
Do I need to import java.lang package any time? Why?
No, you don't need to import it at any time. As this is part of java.lang package is a part of \jdk1.6.0_11{this is the location f your jdk installation directory}\jre\lib\rt.jar and this rt.jar (called...
Anitha
Should we learn DBMS and RDBMS without any Java training?
java or i can say any programming language is not required to learn DBMS or RDBMS
Karthik
0 0
6

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Thread Class In JAVA
Thread Class: Thread class is the main class on which Java's Multithreading system is based. Thread class, along with its companion interface Runnable will be used to create and run threads for utilizing...

How do i get best Campus / Off Campus Placement?
Companies are looking for Skilled Freshers. So build your technical skills while doing MCA / BTech / BCA / BSc (IT or CS) into below areas- 1. Strong your programming & debugging skills ...

What is a Programming Language
What is a Language? Language is a communication system of human. What is a programming Language? A programming Language is a formal constructed language design to communicate...

Use of Service Locator Pattern
If we want to reuse the java code that should be the best approach w.r.t re-usability, maintanence and saving time to concentrate on our own businbess logic/requirement. In the similar approach many patterns...
M

Introduction to Course Content
Video about what we are going to learn throughout the Java Training Session .

Recommended Articles

Java is the most commonly used popular programming language for the creation of web applications and platform today. Integrated Cloud Applications and Platform Services Oracle says, “Java developers worldwide has over 9 million and runs approximately 3 billion mobile phones”.  Right from its first implication as java 1.0...

Read full article >

Designed in a flexible and user-friendly demeanor, Java is the most commonly used programming language for the creation of web applications and platform. It allows developers to “write once, run anywhere” (WORA). It is general-purpose, a high-level programming language developed by Sun Microsystem. Initially known as an...

Read full article >

Java is the most famous programming language till date. 20 years is a big time for any programming language to survive and gain strength. Java has been proved to be one of the most reliable programming languages for networked computers. source:techcentral.com Java was developed to pertain over the Internet. Over...

Read full article >

In the domain of Information Technology, there is always a lot to learn and implement. However, some technologies have a relatively higher demand than the rest of the others. So here are some popular IT courses for the present and upcoming future: Cloud Computing Cloud Computing is a computing technique which is used...

Read full article >

Looking for Java Training Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for Java Training Classes?

The best tutors for Java Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Java Training with the Best Tutors

The best Tutors for Java Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more