Answer Posted / vijayakumar chinnasamy
No static variable cannot be declared within static/non-
static method.
only "final" and "default" allowed within in method for
variable declaration. i.e u cant use
private,protected,public,static within method .it display
the compile time error "Illegal modifier".
| Is This Answer Correct ? | 11 Yes | 1 No |
Post New Answer View All Answers
Can we have multiple catch block for a try block?
Can It is possible to synchronize the constructor of a Java Class?
What are exception handling keywords in java?
What are the actions that can occur when a thread enters blocked state?
What is the difference between jdk, jre, and jvm?
Explain importance of inheritance in java?
Why java strings are immutable in nature?
Why inputstreamreader is used in java?
Which variable is the independent variable?
Draw a UML class diagram for the code fragment given below: public class StringApplet extends Applet { private Label sampleString; private Button showTheString; private ButtonHandler bHandler; private FlowLayout layout; public StringApplet() { sampleString = new Label(" "); showTheString = new Button (" Show the String"); bHandler = new ButtonHandler(); layout = new FlowLayout(); showTheString.addActionListener(bHandler); setLayout(layout); add(sampleString); add(showTheString); } class ButtonHandler implements ActionListener { public void actionPerformed(ActionEvent e) { samplestring.setText("Good Morning"); } } } Note: The methods need not be indicated on the diagram.
Is java se open source?
Does java return by reference?
What is the difference between procedural and object-oriented programs?
Give me example of derived data types.
What is stringwriter?