JAVA Questions

can someone pleaase answer what does .class mean in java.....What does it return...and which function it triggers??
Can we override that function....
Please answer m not getting an appropriate answer anywhere
Thanks in anticipation.........๐Ÿ˜€

Replies

  • PraveenKumar Purushothaman
    PraveenKumar Purushothaman
    Dude? What's your exact question...

    See, Java contains two types of files. One is the source file, which ends in .java and the other is class files, which are compiled files, they end with .class ๐Ÿ˜€
    Is this what you are asking about??? ๐Ÿ˜
  • crazyroshan
    crazyroshan
    if u create a class named Test...and if you do s.o.p(Test.class), which function does it triggers??? got ma q? now please reply.
  • PraveenKumar Purushothaman
    PraveenKumar Purushothaman
    Aha... You got confused with the extension and stuff... See, there is nothing known to the program as Test.class ok? It is the output file. Its like you are asking in a C Program, when you create a class Test and if you give: ๐Ÿ˜
    cout<It is not used inside the code at all!!! ๐Ÿ˜€
                                        
  • crazyroshan
    crazyroshan
    public class test
    {

    public static void main(String arg[])
    {

    System.out.println(test.class);
    }
    }

    please try this ull understand what m asking......i have seen this used in a code....
  • PraveenKumar Purushothaman
    PraveenKumar Purushothaman
    This is not a valid code at all... Anyways, what do you wanna do?
  • crazyroshan
    crazyroshan
    try running it.
  • PraveenKumar Purushothaman
    PraveenKumar Purushothaman
    Oki... I will try... ๐Ÿ˜€
  • PraveenKumar Purushothaman
    PraveenKumar Purushothaman
    It shows
    class test
  • sookie
    sookie
    @crazyroshan

    1. "class" is a literal in java language. Just like you have string literal say "Hello" representing an instance of class String. similarly "class" literal represents an instance of class "Class"

    2. When you specify .class , then it returns the class name[the one defined by #-Link-Snipped-#] of the particular instance referred.

You are reading an archived discussion.

Related Posts

I need avctivation key for microsoft office 2010 professional plus. PLEASE help me.
can you please tell me the code to interface a mobile phone with a microcontroller.. i need to send and recieve a sms usin pic 16F877A.. please tell me the...
OK! We do not want iPhone any more and we need a Android phone. If you say why we should have it, we say we just need it intead of...
Is GRE required for pursuing MS in U.K got confusing replies any comments???????๐Ÿ˜”