Is Java is 100% pure OOPS? Explain?
Answers were Sorted based on User's Feedback
Answer / anand
No java isnt 100% pure OOPS coz if it were then everything
should be classes and objects, whereas java still has
primitive data type which violates the above said
statement...SmallTalk is the only 100% pure OOPS language
| Is This Answer Correct ? | 66 Yes | 9 No |
Answer / prashant khot
No. Java is not 100 % Pune OOP because of following three
reasons:
1) It doesnot support Multiple inheritance.
2) It allows use of primitive data types which are not an
objects.
3) It allows static methods to call without creating the
instance. This disobeys OOPs concepts.
| Is This Answer Correct ? | 48 Yes | 7 No |
Answer / priyanjan
Java is not 100% pure OOP,but 99.34%,because primitive data
types are not treated as object
| Is This Answer Correct ? | 27 Yes | 10 No |
Answer / kruthi
Java is not pure OOPs because of Primitive data type and of
static keyword.
| Is This Answer Correct ? | 22 Yes | 5 No |
Answer / muthusenthil
java is not 100% oops because of only reason it has static
keyword, according to oops and in real world we need an
object to perform a function but in java using class name
without an object we can perform function or call a method
this violates oops and real world reflection..
| Is This Answer Correct ? | 24 Yes | 9 No |
Answer / vikas dwivedi
Yes, Java Is not pure object Oriented Lang.....Bcse of
primtive data type...java is 99.7% pure.
for details cntct..vikas.nice@gmail.com
| Is This Answer Correct ? | 12 Yes | 5 No |
Answer / uttam lonkar
Java is not pure OOPs because of Primitive data type and of
static keyword.
| Is This Answer Correct ? | 5 Yes | 0 No |
Answer / ajay
Java is not 100% pure OOP language because of:
1: Java doesn't support Multiple Inheritence directly.
2: We can call static methods and variables without
creating Object of class which is not supported by OOP.
3: Primitive data type which are not Object.
Those are the reasons why Java is not 100% pure language.
| Is This Answer Correct ? | 5 Yes | 0 No |
Answer / sreevani
No, Java is not 100% pure OOPS. As it does not support the E-
Com server.
| Is This Answer Correct ? | 16 Yes | 14 No |
Question 5 [15] Consider the following classes, illustrating the Strategy design pattern: import java.awt.*; abstract class Text { protected TextApplet tA; protected Text(TextApplet tApplet) { tA = tApplet; } abstract public void draw(Graphics g); } class PlainText extends Text { protected PlainText(TextApplet tApplet) { super(tApplet); } public void draw(Graphics g) { g.setColor(tA.getColor()); g.setFont(new Font("Sans-serif", Font.PLAIN, 12)); g.drawString(tA.getText(), 20, 20); } } class CodeText extends Text { protected CodeText(TextApplet tApplet) { super(tApplet); } public void draw(Graphics g) { g.setColor(tA.getColor()); g.setFont(new Font("Monospaced", Font.PLAIN, 12)); g.drawString(tA.getText(), 20, 20); } } public class TextApplet extends java.applet.Applet { protected Text text; protected String textVal; protected Color color; public String getText() { return textVal; } public Color getColor() { return color; } public void init() { textVal = getParameter("text"); String textStyle = getParameter("style"); String textColor = getParameter("color"); if (textStyle == "code") text = new CodeText(this); else text = new PlainText(this); if (textColor == "red") color = Color.RED; else if (textColor == "blue") color = Color.BLUE; else color = Color.BLACK; } public void paint(Graphics g) { text.draw(g); 10 } } The Text class is more complicated than it should be (there is too much coupling between the Text and TextApplet classes). By getting rid of the reference to a TextApplet object in the Text class and setting the colour in the paint() method, one could turn the Text class into an interface and simplify the strategy classes considerably. 5.1 Rewrite the Text and PlainText classes to do what is described above. (6) 5.2 Explain the consequent changes that are necessary to the TextApplet class. (4) 5.3 Write an additional strategy class called FancyText (to go with your simplified strategy classes) to allow fancy text to be displayed for the value "fancy" provided for the style parameter. It should use the font Font ("Serif", Font.ITALIC, 12). (3) 5.4 Explain what changes are necessary to the TextApplet class for this. (2)
why is multiple inheritance not allowed in java?
7 Answers Elementus Technologies, Huawei, Infosys,
Explain about main() method in java ?
why use interface? if interface declear a method implement in class. why direct implement method in class
Which sorting algorithm is in place?
Why are pointers not secure?
In the below example, how many string objects are created?
What is multiple inheritance? Is it supported by java?
Consider that class classA, abstract class classB, and final classC have been defined.Which one of the following is correct? 1. classA extends classC implements classB 2. class A extends classB, classC 3. classA extends classB 4. classB implements classC
How many bits are used to represent unicode, ascii, utf-16, and utf-8 characters in java programming?
Explain constructors and types of constructors in java.
What are java packages? What's the significance of packages?