CrazyEngineers
  • JAVA Questions

    crazyroshan

    crazyroshan

    @crazyroshan-ySrKLI
    Updated: Oct 20, 2024
    Views: 1.0K
    can someone pleaase answer what does <classname>.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.........😀
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • PraveenKumar Purushothaman

    MemberJun 16, 2011

    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??? 😐
    Are you sure? This action cannot be undone.
    Cancel
  • crazyroshan

    MemberJun 16, 2011

    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.
    Are you sure? This action cannot be undone.
    Cancel
  • PraveenKumar Purushothaman

    MemberJun 16, 2011

    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<<Test.exe<<endl;
    It is not used inside the code at all!!! 😀
    Are you sure? This action cannot be undone.
    Cancel
  • crazyroshan

    MemberJun 16, 2011

    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....
    Are you sure? This action cannot be undone.
    Cancel
  • PraveenKumar Purushothaman

    MemberJun 16, 2011

    This is not a valid code at all... Anyways, what do you wanna do?
    Are you sure? This action cannot be undone.
    Cancel
  • crazyroshan

    MemberJun 16, 2011

    try running it.
    Are you sure? This action cannot be undone.
    Cancel
  • PraveenKumar Purushothaman

    MemberJun 16, 2011

    Oki... I will try... 😀
    Are you sure? This action cannot be undone.
    Cancel
  • PraveenKumar Purushothaman

    MemberJun 16, 2011

    It shows
    class test
    Are you sure? This action cannot be undone.
    Cancel
  • sookie

    MemberJun 16, 2011

    @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 <classname>.class , then it returns the class name[the one defined by #-Link-Snipped-#] of the particular instance referred.
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register