assertion question

class Language{
    public static final int java=1;
    public static final int pascal=2;
    public static final int csharp=3;

public class Mgos  {
    static int lang=0;
    public static void main(String argv[]){
        case Language.pascal:
        case Language.csharp:
            assert false : lang;



I was trying above example from link

did not understand output while running in eclipse ide.

I was trying to understand the output. Wow can i pribt say java to the console.

 Any links, ideas, resources,sample code highly appreciated. thanks in advance.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

That won't do anything unless  you run it with assertions enabled, in which case it will print 0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mick BarryJava DeveloperCommented:
It will not output anything
the value of lang is 0 which does not match any of the switch cases so the default gets executed.
the assert is ignored as assertions are not enabled

gudii9Author Commented:
>>>That won't do anything unless  you run it with assertions enabled, in which case it will print 0

I am getting message on console like

>>Exception in thread "main" java.lang.AssertionError: 0
      at com.vaannila.student.Mgos.main(

after enabling assertion in eclipse ide and ran as java application.

Are you referring to same '0'.

How can i get something like java or pascal. please advise
Mick BarryJava DeveloperCommented:
>     static int lang=0;

change that to:

    static int lang=1;
gudii9Author Commented:
sure. i will try
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.