Sponsored Content
Full Discussion: Java static code
Top Forums Programming Java static code Post 303014266 by scriptor on Thursday 8th of March 2018 08:56:05 AM
Old 03-08-2018
Java static code

HI All

I am new to java in below code I am not able to understand the below line of code
Code:
 
 Student9.change();

the complete code is mentioned as below
Code:
class Student9{  
int rollno;  
String name;  
static String college = "ITS";  
  
static void change(){  
college = "BBDIT";  
 }  
  Student9(int r, String n){  
 rollno = r;  
 name = n;  
 }  
  void display (){System.out.println(rollno+" "+name+" "+college);}  
 public static void main(String args[]){  
Student9.change();  
 Student9 s1 = new Student9 (111,"Karan");  
Student9 s2 = new Student9 (222,"Aryan");  
Student9 s3 = new Student9 (333,"Sonoo");  
 s1.display();  
s2.display();  
s3.display();  
}  
}


Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 03-08-2018 at 12:12 PM.. Reason: Added CODE tags.
 

10 More Discussions You Might Find Interesting

1. IP Networking

I need HELP to Set up Coyote Linux router with 1 static IP & 64 internal static IP

hello, i need help on setting my coyote linux, i've working on this for last 5 days, can't get it to work. I've been posting this message to coyote forum, and other linux forum, but haven't get any answer yet. Hope someone here can help me...... please see my attached picture first. ... (0 Replies)
Discussion started by: dlwoaud
0 Replies

2. Programming

Help with Java code

public class MyMail { public static void main(String args) { // TODO Auto-generated method stub System.out.println("number of args " + args.length); String from = ""; String to = ""; String subject = ""; String emailText = ""; for... (0 Replies)
Discussion started by: eel
0 Replies

3. Programming

Help with PrintWriter code in JAVA

I'm creating a file which contained the field name, student ID, house phone number, mobile number and address. Sometimes people don't enter the house phone number. However, in the file I created still print out the house phone number without any data. How do I get rid of this field when people... (1 Reply)
Discussion started by: eel
1 Replies

4. Programming

Help with splitter code in JAVA

I was creating a file using splitter and printwriter. The result in the file come out as: TO:bbb,ccc,eee Instead of, TO:bbb TO:ccc TO:eee May I know what's wrong with this? (1 Reply)
Discussion started by: eel
1 Replies

5. Programming

can i have an optimal solution for this java code ? Facing Java heap space problem even at 3GB heaps

My desired output is run: for this 1 for this 2 for this 3 for this 4 for this 5 for this 1,2 1->2 for this 2,3 2->3 for this 3,4 3->4 for this 4,5 4->5 for this 1,2,3 1->2,3 (2 Replies)
Discussion started by: vaibhavkorde
2 Replies

6. UNIX for Advanced & Expert Users

Static code analysis for Perl

As an addition to our ongoing investigation into static code analysis tools for a Perl programming we are maintaining, can anyone recommend a certain tool that he/she is experienced with? We are already actively using perl::critic (Perl::Critic) and rats... (2 Replies)
Discussion started by: figaro
2 Replies

7. Programming

Even the Static cURL Library Isn't Static

I'm writing a program which uses curl to be run on Linux PCs which will be used by a number of different users. I cannot make the users all install curl on their individual machines, so I have tried to link curl in statically, rather than using libcurl.so. I downloaded the source and created a... (8 Replies)
Discussion started by: BrandonShw
8 Replies

8. Shell Programming and Scripting

Block of code replacement in Java source code through Unix script

Hi, I want to remove the following code from Source files (or replace the code with empty.) from all the source files in given directory. finally { if (null != hibernateSession && hibernateSession.isOpen()) { //hibernateSession.close(); } } It would be great if the script has... (2 Replies)
Discussion started by: hareeshram
2 Replies

9. Linux

Linux through Java code

Hi How can I write a Java program to execute Linux commands? What is the best approach: Invoking the Linux shell within Java and executing commands or, using the Java APIs to do the stuff. Since it is platform independent, it'll know itself what to do. We need not check which OS the Java... (1 Reply)
Discussion started by: Dorothy
1 Replies

10. Programming

Help with a Java code

Hi all I am currently learning Java (and Fortran!) on my own. I have written the following code but for some reason it does not work as it should import javax.swing.JOptionPane; class evenOdd { public static void main(String args) { String number, ans; int num; ... (4 Replies)
Discussion started by: faizlo
4 Replies
XtAppCreateShell(3)						   XT FUNCTIONS 					       XtAppCreateShell(3)

NAME
XtAppCreateShell, XtVaAppCreateShell - create top-level widget instance SYNTAX
Widget XtAppCreateShell(String application_name, String application_class, WidgetClass widget_class, Display *display, ArgList args, Cardi- nal num_args); Widget XtVaAppCreateShell(String application_name, String application_class, WidgetClass widget_class, Display *display, ...); ARGUMENTS
application_name Specifies the name of the application instance. application_class Specifies the class name of this application. widget_class Specifies the widget class that the application top-level widget should be. display Specifies the display from which to get the resources. args Specifies the argument list from which to get the resources. num_args Specifies the number of arguments in the argument list. ... Specifies the variable argument list from which to get the resources. DESCRIPTION
The XtAppCreateShell function saves the specified application name and application class for qualifying all widget resource specifiers. The application name and application class are used as the left-most components in all widget resource names for this application. XtApp- CreateShell should be used to create a new logical application within a program or to create a shell on another display. In the first case, it allows the specification of a new root in the resource hierarchy. In the second case, it uses the resource database associated with the other display. Note that the widget returned by XtAppCreateShell has the WM_COMMAND property set for session managers (see Chapter 4). SEE ALSO
XtCreateWidget(3) X Toolkit Intrinsics - C Language Interface Xlib - C Language X Interface X Version 11 libXt 1.1.3 XtAppCreateShell(3)
All times are GMT -4. The time now is 04:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy