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

What is IBM RAD(Rational Application Developer)?
RAD means Rational Application Developer for WebSphere Software accelerates the development and deployment of Java, Java EE, Web 2.0, mobile, OSGi, portal and service-oriented architecture (SOA) applications....
Ashish
Is learning Java worthwhile?
Yes, learning Java can be worthwhile as it is widely used in various industries, including web development, mobile app development, and enterprise applications.
Shantanu
0 0
5
Who invented Java language?
James Gosling. You could have google it!!
Niranjan

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

Ask a Question

Related Lessons


TestNG Annotations and its sequence
public class TestNGAnnotations { @BeforeMethod public void beforeM() { System.out.println("Before Method"); } @AfterMethod public void afterMethod() { System.out.println("After Method"); } @BeforeClass...
S

Sarthak C.

0 0
0

Session Tracking In Java Servlets
Session Tracking: HTTP is a stateless protocol. Each request is independent of the previous one. However, in some applications, it is necessary to save state information so that information can be collected...

What Are IT Industries Performance Metrics?
1. Outstanding Expectation: Eligible to get Promotion easily and good salary hike. Always preferrable to go abroad. 2. Exceed Expectation: Can get Promotion as per schedule of company with good salary...

Spring - Dependency Injection (DI)
Spring - Dependency Injection (DI) DI is a framework which provides loose coupling in code. Here loose coupling means no hard coding of the object. Instead of hard coding, we will be injecting these object...

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