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

Hi , this is Mithun Ghosh from Kolkata. I want a suggestion about the course content of teaching Java starting from core to Advanced level. Please anyone do help with a legible course content. Thanks in advance -- Thanks & Regards, Mithun Ghosh
Hi Mithun, This is AkiraITSolutions, We do provide real time training with real time employees, who ever having more than 10 years of IT Experience. For further details please feel free to reach us.
Mithun Ghosh
What exactly the work of constructor( default, parameterized) especially about instance variables initialization. Suppose user initialize the instance variables explicitly. Then what is the use of parameterized constructor over here.. Please reply me
Construct as the name suggest are used to construct the object. So, they are invoked only once and that too at the time of object creation. Default Constructor : Initialize all the instance variables...
Surekha
How do I learn Java? From book or internet or a coaching?
It is good to learn Java from Coaching where you will get more exposure in learning at faster pace.
Suresh
0 0
7
What are the benefits of attending Java coaching classes?
Today Java is the basic requirement for the software industry by learning advanced concepts in java you will have a very good job prospective's. Even if you want to learn BIg Data, testing tools ect.....
Selvi
0 0
5

 I want to learn from beginning, please tell me what is the best source to learn (core java)

hi sunaini It is very good that you want to learn programming... I would recommend you c,c++,java and dotnet courses...for becoming a good provrammer.. we provide online training..at lowest prices if...
Sunaini

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

CoreJAVA
Core Java Training High Level Course Content Trained by Java Architect 1. Core Java Programming Introduction of Java 2. Data types and Operators 3. Control Flow statements 4. OOPS and its application...
A

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...

How can everyone prepare to clear any Java interview?
Java interview your java should be much strong then J2EE. core java and Advance java is the basic foundation for Interview. Some of the topic about which you should know before going for a java interview...

SWITCH STATEMENT IN JAVA
switch statement - condition statement - only once the checking takes place so we recommend use break statement. switch(condition/variable/choice){case 1: //statements break;case 2: // statements break;case...

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