What is a concrete classes? Is Java object class is concrete class?
Why in C++ (0.1 + 0.1) is not equal to 0.2 ??
The floating-point arithmetic in most computer languages is based on binary fractions (1/2, 1/4, 1/8, 1/16, ...) and not decimal fractions (1/10, 1/100, 1/1000, 1/1000,...)there is no ActionScript Number that is exactly equal to 0.1 because it require an infinite number of binary fractional bits.
What is the situation you will need to use partial class in .Net
Visual Studio uses partial classes to separate auto-generated code from user-generated code. Example:Let us consider that visual studio creates a file called Form1.Designer.cs which holds the designe...
Where do you use partial class ? Explain with real time scenario of the usage ?
Splitting the class into multiple files is called as partial class.The compiler treated the files as different classes but during compilation these files will be treated as a single class. Example:If...
First of all abstract is a key word. Abstract classes are having both defined methods and undefined methods. Concrete classes having only defined methods in the case of concrete classes the execution ...
Can any one give a real time example program for abstract class and virtual functions plzzzzzzzz
Int i;void main(){ int j=100,k; cout
Compilation fails, why because it does not have proper syntax and structure.
This program gives error becoz here j=100 but the value of j is not used.
Access the members of child class
How is that we can make a parent class to access the members of child class?
What is the output of this code?
If(condition) { printf("hello"); } else { printf("world"); }
if condition is true then "hello" will print else "world".
We are writing what it actually .I mean it is error object or else other
iserrorpage is attribute of page, While executing the page it throws any errors then it returns Exception Object
If in MyErrorPage.jsp<%@ page isErroPage="true" %>is written it doesn't mean this is an Error Object.If this page is included as error page in any other jsp (suppose MyPage.jsp) us...
Why is multiple inheritance not allowed in Java?
this is so because it leads to a problem called "dirty diamond".
that is, say class B and C inherit from class A.
class B and C might override the methods in A.
Now if D inherits from B and C(multiple inheritance), there would be a problem that which overridden method would it inherit
Due to the naming complexity in Base & Drived classes,
We Can't provide a solution every time using Inheritance with same name of member,methods.
That's why It's not allowed in JAVA.
Imp: Multiple Inheritance is allowed in Java In Only the case of Interfaces.
Is super a keyword or method? Explain why?
This is basically used to call the constructor of the base class. It is a method of course.
super is a keyword in Java because it is defined as keyword in java and super is not a keyword or variable which belongs to any class.
How is memory allocated by new ?A) in a heap b) in a stack b) both a & b c) none of these.
By creating object to an class by using "new" keyword shows that JVM allocates memory in heap area.
in heap
yes it can be done by singliton class
Preventing direct instantiationWe all know how objects are instantiated right? Maybe not everyone? Let's go through a quick refresher.Objects are instantiated by using the new keyword. The new keyword...
Can we provide the constructor in abstact class? If yes why? What is internal mechanism of JVM
An abstract class can always have a constructor for a reason that an abstract class even though cannot be instantiated but it can be extended. Once its extended by its subclass. the object of the subc...
What types of diagrams are generally created while designing an use case / functionality ?
Most frequently used diagrams are- class diagram- sequence diagramrarely used- component diagram- package diagramclass diagram a diagram that shows a collection of declarative (static) model elements, such as classes, types and their content and relationshipsequence describes an interaction by focusing...
Class Diagram : They describe the static structure of a system.Package Diagram : Package diagrams organize elements of a system into related groups to minimize depend...
Why friend function cannot be used to overload the assignment operator?
Java is actually designed to work same as C++ but avoid complex features like operator overloading, friend functions, multiple inheritence.
In Java it is not possible to overloading OPERATOR such as +/-/* etc. We can do that is C++.
In Java there won't be any friend function. ...
That is why we can't use friend function overloading in Java
What is differents between object and static object?
An Object is an physical entity of logical class definition, and in Java there is nothing called static object.
in java there is no concept of static object
What is the difference between call by value, call by reference, call by address?
No answers
call by value--->You are passing primitive value for your method argument.
call by ref--->You are passing object
call by address-->reference and address both are same.
In call by value, value is passed and in call by reference, base address is passed.
Run-time polymorphism provides the ability to use late-binding. In other words, the function called or the data member accessed is not determined until run-time and is based on the type that a v...
Purpose of Runtime polymorphism:Run time polymorphism is a mechanism by which a call to overriden function is resolved at runtime rather than compile time.For e.gIf (user clicks link 1) then{obj1.over...
What are advantages of inner class
Answered by: ssalguti
Member Since Apr-2008 | Answered On : Apr 25th, 2008
Logical grouping of classes—If a class is useful to only one other class, then it is logical to embed it in that class and keep the two together. Nesting such "helper classes" makes their package more streamlined.
Increased encapsulation—Consider two top-level classes, A and B, where B needs access to members of A that would otherwise be declared private. By hiding class B within class A, A's members can be declared private and B can access them. In addition, B itself can be hidden from the outside world.
More readable, maintainable code—Nesting small classes within top-level classes places the code closer to where it is used.
Defining a class within another class is known as nested class.
If class B is defined within class A, then B is known to A, but not outside of A.
Class B has access to the members, including private members of the Class A.
However,the class A does not have access to the members of Class B.
Logical grouping of classes—If a class is useful to only one other class, then it is logical to embed it in that class and keep the two together. Nesting such "helper classes" makes th...
Concrete class is a class with implementation for all the methods in it. Concrete class defines all the abstract methods of an abstract class which it is extending. Object class is a concrete class.
concrete class is made up of 50% cement n 45% gravels mixed with !/2 glass of water....